@@ -71,7 +71,14 @@ def _preprocess_inputs(path):
71
71
72
72
73
73
def get_ircadb_data (path : Union [os .PathLike , str ], download : bool = False ) -> str :
74
- """
74
+ """Download the IRCADb dataset.
75
+
76
+ Args:
77
+ path: Filepath to a folder where the data is downloaded for further processing.
78
+ download: Whether to download the data if it is not present.
79
+
80
+ Returns:
81
+ Filepath where the data is downloaded.
75
82
"""
76
83
data_dir = os .path .join (path , "data" )
77
84
if os .path .exists (data_dir ):
@@ -91,7 +98,14 @@ def get_ircadb_data(path: Union[os.PathLike, str], download: bool = False) -> st
91
98
def get_ircadb_paths (
92
99
path : Union [os .PathLike , str ], split : Optional [Literal ["train" , "val" , "test" ]] = None , download : bool = False ,
93
100
) -> List [str ]:
94
- """
101
+ """Get paths to the IRCADb data.
102
+
103
+ Args:
104
+ path: Filepath to a folder where the data is downloaded for further processing.
105
+ download: Whether to download the data if it is not present.
106
+
107
+ Returns:
108
+ List of filepaths for the volumetric data.
95
109
"""
96
110
97
111
data_dir = get_ircadb_data (path , download )
@@ -120,7 +134,19 @@ def get_ircadb_dataset(
120
134
download : bool = False ,
121
135
** kwargs
122
136
) -> Dataset :
123
- """
137
+ """Get the IRCADb dataset for liver (and other organ) segmentation.
138
+
139
+ Args:
140
+ path: Filepath to a folder where the data is downloaded for further processing.
141
+ patch_shape: The patch shape to use for training.
142
+ label_choice: The choice of labelled organs.
143
+ split: The choice of data split.
144
+ resize_inputs: Whether to resize the inputs to the expected patch shape.
145
+ download: Whether to download the data if it is not present.
146
+ kwargs: Additional keyword arguments for `torch_em.default_segmentation_dataset`.
147
+
148
+ Returns:
149
+ The segmentation dataset.
124
150
"""
125
151
volume_paths = get_ircadb_paths (path , split , download )
126
152
@@ -155,7 +181,20 @@ def get_ircadb_loader(
155
181
download : bool = False ,
156
182
** kwargs
157
183
) -> DataLoader :
158
- """
184
+ """Get the IRCADb dataloader for liver (and other organ) segmentation.
185
+
186
+ Args:
187
+ path: Filepath to a folder where the data is downloaded for further processing.
188
+ batch_size: The batch size for training.
189
+ patch_shape: The patch shape to use for training.
190
+ label_choice: The choice of labelled organs.
191
+ split: The choice of data split.
192
+ resize_inputs: Whether to resize the inputs to the expected patch shape.
193
+ download: Whether to download the data if it is not present.
194
+ kwargs: Additional keyword arguments for `torch_em.default_segmentation_dataset` or for the PyTorch DataLoader.
195
+
196
+ Returns:
197
+ The DataLoader.
159
198
"""
160
199
ds_kwargs , loader_kwargs = util .split_kwargs (torch_em .default_segmentation_dataset , ** kwargs )
161
200
dataset = get_ircadb_dataset (path , patch_shape , label_choice , split , resize_inputs , download , ** ds_kwargs )
0 commit comments