nicoalpis commited on
Commit
bea0959
·
1 Parent(s): 23611ed

Release model

Browse files
inference.ipynb ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 6,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import torch\n",
10
+ "from batchgenerators.utilities.file_and_folder_operations import join\n",
11
+ "from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor\n",
12
+ "from nnunetv2.imageio.simpleitk_reader_writer import SimpleITKIO"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 2,
18
+ "metadata": {},
19
+ "outputs": [],
20
+ "source": [
21
+ "# instantiate the nnUNetPredictor\n",
22
+ "predictor = nnUNetPredictor(\n",
23
+ " tile_step_size=0.5, # 50% overlap between adjacent tiles\n",
24
+ " use_gaussian=True, # Apply Gaussian weighting to smooth tile edges\n",
25
+ " use_mirroring=True, # Enable test-time augmentation via flipping\n",
26
+ " perform_everything_on_device=True, # Perform all steps (preprocessing, prediction) on GPU\n",
27
+ " device=torch.device('cuda', 0), # Use the first GPU (cuda:0) for computations\n",
28
+ " verbose=False, # Disable detailed output logs during prediction\n",
29
+ " verbose_preprocessing=False, # Disable logs during preprocessing\n",
30
+ " allow_tqdm=True # Show progress bar during long tasks\n",
31
+ ")"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "execution_count": null,
37
+ "metadata": {},
38
+ "outputs": [],
39
+ "source": [
40
+ "# initializes the network architecture, loads the checkpoint\n",
41
+ "predictor.initialize_from_trained_model_folder(\n",
42
+ " \"./nnUNet_weights\", # Path to the model weights\n",
43
+ " use_folds=(0,1,2,3,4), # Use all 5 folds (for cross-validation)\n",
44
+ " checkpoint_name='checkpoint_best.pth', # File name of model checkpoints (all must be equal)\n",
45
+ ")"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "execution_count": null,
51
+ "metadata": {},
52
+ "outputs": [],
53
+ "source": [
54
+ "# variant 1: give input and output folders\n",
55
+ "# Note: if specific file path is provided, no need for \"_0000.nii.gz\" file ending;\n",
56
+ "# Note: if input folder path is provided, the input files MUST include \"_0000.nii.gz\" ending.\n",
57
+ "predictor.predict_from_files(\n",
58
+ " \"./input_images\", # Input folder with image files\n",
59
+ " \"./output_images\", # Output folder for predictions\n",
60
+ " save_probabilities=False, # Do not save the predicted probabilities, just the segmentation\n",
61
+ " overwrite=False, # Do not overwrite existing results in the output folder\n",
62
+ " num_processes_preprocessing=2, # Number of processes for preprocessing\n",
63
+ " num_processes_segmentation_export=2, # Number of processes for exporting the segmentation\n",
64
+ " folder_with_segs_from_prev_stage=None, # No previous stage segmentations used\n",
65
+ " num_parts=1, # Number of parts to divide the prediction task into\n",
66
+ " part_id=0 # ID of the current part (only one part in this case)\n",
67
+ ")"
68
+ ]
69
+ },
70
+ {
71
+ "cell_type": "code",
72
+ "execution_count": null,
73
+ "metadata": {},
74
+ "outputs": [],
75
+ "source": [
76
+ "# variant 2.1, use list of files as inputs. Note how we use nested lists!!!\n",
77
+ "indir = \"./input_images\" # Input folder with image files\n",
78
+ "outdir = \"./output_images\" # Output folder for predictions\n",
79
+ "predictor.predict_from_files(\n",
80
+ " [[join(indir, 'img0027_0000.nii.gz')]],\n",
81
+ " [join(outdir, 'img0027_pred.nii.gz')],\n",
82
+ " save_probabilities=False,\n",
83
+ " overwrite=False,\n",
84
+ " num_processes_preprocessing=2,\n",
85
+ " num_processes_segmentation_export=2,\n",
86
+ " folder_with_segs_from_prev_stage=None,\n",
87
+ " num_parts=1,\n",
88
+ " part_id=0\n",
89
+ ")"
90
+ ]
91
+ },
92
+ {
93
+ "cell_type": "code",
94
+ "execution_count": null,
95
+ "metadata": {},
96
+ "outputs": [],
97
+ "source": [
98
+ "# variant 2.2, returns segmentations (The predicted segmentations will be returned if the output_files are not specified)\n",
99
+ "indir = \"./input_images\"\n",
100
+ "predicted_segmentations = predictor.predict_from_files(\n",
101
+ " [[join(indir, 'img0027_0000.nii.gz')], [join(indir, 'img0027_0000.nii.gz')]], # Example of several input images with repeated sample\n",
102
+ " None,\n",
103
+ " save_probabilities=False,\n",
104
+ " overwrite=True,\n",
105
+ " num_processes_preprocessing=2,\n",
106
+ " num_processes_segmentation_export=2,\n",
107
+ " folder_with_segs_from_prev_stage=None,\n",
108
+ " num_parts=1,\n",
109
+ " part_id=0)"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "code",
114
+ "execution_count": null,
115
+ "metadata": {},
116
+ "outputs": [],
117
+ "source": [
118
+ "# variant 3.1, predict a list of numpy arrays\n",
119
+ "indir = \"./input_images\"\n",
120
+ "img, props = SimpleITKIO().read_images([join(indir, 'img0027_0000.nii.gz')])\n",
121
+ "\n",
122
+ "# we do not set output files so that the segmentations will be returned. You can of course also specify output\n",
123
+ "# files instead (no return value on that case)\n",
124
+ "ret = predictor.predict_from_list_of_npy_arrays(\n",
125
+ " [img,],\n",
126
+ " None,\n",
127
+ " [props,],\n",
128
+ " None,\n",
129
+ " 2,\n",
130
+ " save_probabilities=False,\n",
131
+ " num_processes_segmentation_export=2)"
132
+ ]
133
+ },
134
+ {
135
+ "cell_type": "code",
136
+ "execution_count": null,
137
+ "metadata": {},
138
+ "outputs": [],
139
+ "source": [
140
+ "# variant 3.2, predict a single numpy array\n",
141
+ "img, props = SimpleITKIO().read_images([\"./input_images/img0027_0000.nii.gz\"])\n",
142
+ "ret = predictor.predict_single_npy_array(img, props, None, None, False)"
143
+ ]
144
+ }
145
+ ],
146
+ "metadata": {
147
+ "kernelspec": {
148
+ "display_name": "Python 3 (ipykernel)",
149
+ "language": "python",
150
+ "name": "python3"
151
+ },
152
+ "language_info": {
153
+ "codemirror_mode": {
154
+ "name": "ipython",
155
+ "version": 3
156
+ },
157
+ "file_extension": ".py",
158
+ "mimetype": "text/x-python",
159
+ "name": "python",
160
+ "nbconvert_exporter": "python",
161
+ "pygments_lexer": "ipython3",
162
+ "version": "3.10.13"
163
+ }
164
+ },
165
+ "nbformat": 4,
166
+ "nbformat_minor": 4
167
+ }
input_images/.DS_Store ADDED
Binary file (6.15 kB). View file
 
input_images/img0027_0000.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed3f94687c40917563582fb3194d6842aaced08a7126a143e0cd615c29d3ac69
3
+ size 22328379
nnUNet_weights/dataset.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ {
3
+ "channel_names": {
4
+ "0": "CT"
5
+ },
6
+ "labels": {
7
+ "background": 0,
8
+ "spleen": 1,
9
+ "right_kidney": 2,
10
+ "left_kidney": 3,
11
+ "gallbladder": 4,
12
+ "esophagus": 5,
13
+ "liver": 6,
14
+ "stomach": 7,
15
+ "aorta": 8,
16
+ "inferior_vena_cava": 9,
17
+ "pancreas": 10,
18
+ "right_adrenal_gland": 11,
19
+ "left_adrenal_gland": 12
20
+ },
21
+ "numTraining": 680,
22
+ "file_ending": ".nii.gz"
23
+ }
nnUNet_weights/fold_0/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ceac674e7e799626a5e173d12222568d5cacbdc90d8708e4f86d43e7be27866
3
+ size 250815382
nnUNet_weights/fold_1/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a5d19b0069716fde0175c2329954a3b29ba15768be5b726008f3af3f0b06587
3
+ size 250799830
nnUNet_weights/fold_2/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6adce1b59eadf21aec0ff7f3ff516f98e688263bc12e3a7f6479e733cdeb83f5
3
+ size 250811286
nnUNet_weights/fold_3/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a132420a9fadd15776652d289c1b20750cda4c8c689644322ccedd00d7c494a
3
+ size 250788502
nnUNet_weights/fold_4/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e93d0d991a1ee5f2d57837437535a1c61ee5d97cf69d5d361a026f97271b6464
3
+ size 250804822
nnUNet_weights/plans.json ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset060_Merged_Def",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 1.5,
6
+ 1.5,
7
+ 1.5
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 237,
11
+ 259,
12
+ 319
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 0,
17
+ 1,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 0,
22
+ 1,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 195,
30
+ "patch_size": [
31
+ 224,
32
+ 288
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 206.0,
36
+ 267.0
37
+ ],
38
+ "spacing": [
39
+ 1.5,
40
+ 1.5
41
+ ],
42
+ "normalization_schemes": [
43
+ "CTNormalization"
44
+ ],
45
+ "use_mask_for_norm": [
46
+ false
47
+ ],
48
+ "UNet_class_name": "PlainConvUNet",
49
+ "UNet_base_num_features": 32,
50
+ "n_conv_per_stage_encoder": [
51
+ 2,
52
+ 2,
53
+ 2,
54
+ 2,
55
+ 2,
56
+ 2
57
+ ],
58
+ "n_conv_per_stage_decoder": [
59
+ 2,
60
+ 2,
61
+ 2,
62
+ 2,
63
+ 2
64
+ ],
65
+ "num_pool_per_axis": [
66
+ 5,
67
+ 5
68
+ ],
69
+ "pool_op_kernel_sizes": [
70
+ [
71
+ 1,
72
+ 1
73
+ ],
74
+ [
75
+ 2,
76
+ 2
77
+ ],
78
+ [
79
+ 2,
80
+ 2
81
+ ],
82
+ [
83
+ 2,
84
+ 2
85
+ ],
86
+ [
87
+ 2,
88
+ 2
89
+ ],
90
+ [
91
+ 2,
92
+ 2
93
+ ]
94
+ ],
95
+ "conv_kernel_sizes": [
96
+ [
97
+ 3,
98
+ 3
99
+ ],
100
+ [
101
+ 3,
102
+ 3
103
+ ],
104
+ [
105
+ 3,
106
+ 3
107
+ ],
108
+ [
109
+ 3,
110
+ 3
111
+ ],
112
+ [
113
+ 3,
114
+ 3
115
+ ],
116
+ [
117
+ 3,
118
+ 3
119
+ ]
120
+ ],
121
+ "unet_max_num_features": 512,
122
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
123
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
124
+ "resampling_fn_data_kwargs": {
125
+ "is_seg": false,
126
+ "order": 3,
127
+ "order_z": 0,
128
+ "force_separate_z": null
129
+ },
130
+ "resampling_fn_seg_kwargs": {
131
+ "is_seg": true,
132
+ "order": 1,
133
+ "order_z": 0,
134
+ "force_separate_z": null
135
+ },
136
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
137
+ "resampling_fn_probabilities_kwargs": {
138
+ "is_seg": false,
139
+ "order": 1,
140
+ "order_z": 0,
141
+ "force_separate_z": null
142
+ },
143
+ "batch_dice": true
144
+ },
145
+ "3d_fullres": {
146
+ "data_identifier": "nnUNetPlans_3d_fullres",
147
+ "preprocessor_name": "DefaultPreprocessor",
148
+ "batch_size": 2,
149
+ "patch_size": [
150
+ 256,
151
+ 160,
152
+ 224
153
+ ],
154
+ "median_image_size_in_voxels": [
155
+ 291.0,
156
+ 206.0,
157
+ 267.0
158
+ ],
159
+ "spacing": [
160
+ 1.5,
161
+ 1.5,
162
+ 1.5
163
+ ],
164
+ "normalization_schemes": [
165
+ "CTNormalization"
166
+ ],
167
+ "use_mask_for_norm": [
168
+ false
169
+ ],
170
+ "UNet_class_name": "PlainConvUNet",
171
+ "UNet_base_num_features": 32,
172
+ "n_conv_per_stage_encoder": [
173
+ 2,
174
+ 2,
175
+ 2,
176
+ 2,
177
+ 2,
178
+ 2
179
+ ],
180
+ "n_conv_per_stage_decoder": [
181
+ 2,
182
+ 2,
183
+ 2,
184
+ 2,
185
+ 2
186
+ ],
187
+ "num_pool_per_axis": [
188
+ 5,
189
+ 5,
190
+ 5
191
+ ],
192
+ "pool_op_kernel_sizes": [
193
+ [
194
+ 1,
195
+ 1,
196
+ 1
197
+ ],
198
+ [
199
+ 2,
200
+ 2,
201
+ 2
202
+ ],
203
+ [
204
+ 2,
205
+ 2,
206
+ 2
207
+ ],
208
+ [
209
+ 2,
210
+ 2,
211
+ 2
212
+ ],
213
+ [
214
+ 2,
215
+ 2,
216
+ 2
217
+ ],
218
+ [
219
+ 2,
220
+ 2,
221
+ 2
222
+ ]
223
+ ],
224
+ "conv_kernel_sizes": [
225
+ [
226
+ 3,
227
+ 3,
228
+ 3
229
+ ],
230
+ [
231
+ 3,
232
+ 3,
233
+ 3
234
+ ],
235
+ [
236
+ 3,
237
+ 3,
238
+ 3
239
+ ],
240
+ [
241
+ 3,
242
+ 3,
243
+ 3
244
+ ],
245
+ [
246
+ 3,
247
+ 3,
248
+ 3
249
+ ],
250
+ [
251
+ 3,
252
+ 3,
253
+ 3
254
+ ]
255
+ ],
256
+ "unet_max_num_features": 320,
257
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
258
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
259
+ "resampling_fn_data_kwargs": {
260
+ "is_seg": false,
261
+ "order": 3,
262
+ "order_z": 0,
263
+ "force_separate_z": null
264
+ },
265
+ "resampling_fn_seg_kwargs": {
266
+ "is_seg": true,
267
+ "order": 1,
268
+ "order_z": 0,
269
+ "force_separate_z": null
270
+ },
271
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
272
+ "resampling_fn_probabilities_kwargs": {
273
+ "is_seg": false,
274
+ "order": 1,
275
+ "order_z": 0,
276
+ "force_separate_z": null
277
+ },
278
+ "batch_dice": false
279
+ }
280
+ },
281
+ "experiment_planner_used": "ExperimentPlanner",
282
+ "label_manager": "LabelManager",
283
+ "foreground_intensity_properties_per_channel": {
284
+ "0": {
285
+ "max": 5805.0,
286
+ "mean": 64.62580871582031,
287
+ "median": 76.0,
288
+ "min": -2048.0,
289
+ "percentile_00_5": -981.9942016601562,
290
+ "percentile_99_5": 1093.97589111328125,
291
+ "std": 140.14614868164062
292
+ }
293
+ }
294
+ }
output_images/dataset.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "CT"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "spleen": 1,
8
+ "right_kidney": 2,
9
+ "left_kidney": 3,
10
+ "gallbladder": 4,
11
+ "esophagus": 5,
12
+ "liver": 6,
13
+ "stomach": 7,
14
+ "aorta": 8,
15
+ "inferior_vena_cava": 9,
16
+ "pancreas": 10,
17
+ "right_adrenal_gland": 11,
18
+ "left_adrenal_gland": 12
19
+ },
20
+ "numTraining": 680,
21
+ "file_ending": ".nii.gz"
22
+ }
output_images/img0027_gt.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b11fa6b2d42da7904204a74b06b739b3485d37316d8b396448a23502fc339c33
3
+ size 973825
output_images/img0027_pred.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1967b6064f316d0970abb90d38d013f3ceb770aec1e9982d0c3d9dda117120a
3
+ size 79942
output_images/plans.json ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset060_Merged_Def",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 1.5,
6
+ 1.5,
7
+ 1.5
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 237,
11
+ 259,
12
+ 319
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 0,
17
+ 1,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 0,
22
+ 1,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 195,
30
+ "patch_size": [
31
+ 224,
32
+ 288
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 206.0,
36
+ 267.0
37
+ ],
38
+ "spacing": [
39
+ 1.5,
40
+ 1.5
41
+ ],
42
+ "normalization_schemes": [
43
+ "CTNormalization"
44
+ ],
45
+ "use_mask_for_norm": [
46
+ false
47
+ ],
48
+ "UNet_class_name": "PlainConvUNet",
49
+ "UNet_base_num_features": 32,
50
+ "n_conv_per_stage_encoder": [
51
+ 2,
52
+ 2,
53
+ 2,
54
+ 2,
55
+ 2,
56
+ 2
57
+ ],
58
+ "n_conv_per_stage_decoder": [
59
+ 2,
60
+ 2,
61
+ 2,
62
+ 2,
63
+ 2
64
+ ],
65
+ "num_pool_per_axis": [
66
+ 5,
67
+ 5
68
+ ],
69
+ "pool_op_kernel_sizes": [
70
+ [
71
+ 1,
72
+ 1
73
+ ],
74
+ [
75
+ 2,
76
+ 2
77
+ ],
78
+ [
79
+ 2,
80
+ 2
81
+ ],
82
+ [
83
+ 2,
84
+ 2
85
+ ],
86
+ [
87
+ 2,
88
+ 2
89
+ ],
90
+ [
91
+ 2,
92
+ 2
93
+ ]
94
+ ],
95
+ "conv_kernel_sizes": [
96
+ [
97
+ 3,
98
+ 3
99
+ ],
100
+ [
101
+ 3,
102
+ 3
103
+ ],
104
+ [
105
+ 3,
106
+ 3
107
+ ],
108
+ [
109
+ 3,
110
+ 3
111
+ ],
112
+ [
113
+ 3,
114
+ 3
115
+ ],
116
+ [
117
+ 3,
118
+ 3
119
+ ]
120
+ ],
121
+ "unet_max_num_features": 512,
122
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
123
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
124
+ "resampling_fn_data_kwargs": {
125
+ "is_seg": false,
126
+ "order": 3,
127
+ "order_z": 0,
128
+ "force_separate_z": null
129
+ },
130
+ "resampling_fn_seg_kwargs": {
131
+ "is_seg": true,
132
+ "order": 1,
133
+ "order_z": 0,
134
+ "force_separate_z": null
135
+ },
136
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
137
+ "resampling_fn_probabilities_kwargs": {
138
+ "is_seg": false,
139
+ "order": 1,
140
+ "order_z": 0,
141
+ "force_separate_z": null
142
+ },
143
+ "batch_dice": true
144
+ },
145
+ "3d_fullres": {
146
+ "data_identifier": "nnUNetPlans_3d_fullres",
147
+ "preprocessor_name": "DefaultPreprocessor",
148
+ "batch_size": 2,
149
+ "patch_size": [
150
+ 256,
151
+ 160,
152
+ 224
153
+ ],
154
+ "median_image_size_in_voxels": [
155
+ 291.0,
156
+ 206.0,
157
+ 267.0
158
+ ],
159
+ "spacing": [
160
+ 1.5,
161
+ 1.5,
162
+ 1.5
163
+ ],
164
+ "normalization_schemes": [
165
+ "CTNormalization"
166
+ ],
167
+ "use_mask_for_norm": [
168
+ false
169
+ ],
170
+ "UNet_class_name": "PlainConvUNet",
171
+ "UNet_base_num_features": 32,
172
+ "n_conv_per_stage_encoder": [
173
+ 2,
174
+ 2,
175
+ 2,
176
+ 2,
177
+ 2,
178
+ 2
179
+ ],
180
+ "n_conv_per_stage_decoder": [
181
+ 2,
182
+ 2,
183
+ 2,
184
+ 2,
185
+ 2
186
+ ],
187
+ "num_pool_per_axis": [
188
+ 5,
189
+ 5,
190
+ 5
191
+ ],
192
+ "pool_op_kernel_sizes": [
193
+ [
194
+ 1,
195
+ 1,
196
+ 1
197
+ ],
198
+ [
199
+ 2,
200
+ 2,
201
+ 2
202
+ ],
203
+ [
204
+ 2,
205
+ 2,
206
+ 2
207
+ ],
208
+ [
209
+ 2,
210
+ 2,
211
+ 2
212
+ ],
213
+ [
214
+ 2,
215
+ 2,
216
+ 2
217
+ ],
218
+ [
219
+ 2,
220
+ 2,
221
+ 2
222
+ ]
223
+ ],
224
+ "conv_kernel_sizes": [
225
+ [
226
+ 3,
227
+ 3,
228
+ 3
229
+ ],
230
+ [
231
+ 3,
232
+ 3,
233
+ 3
234
+ ],
235
+ [
236
+ 3,
237
+ 3,
238
+ 3
239
+ ],
240
+ [
241
+ 3,
242
+ 3,
243
+ 3
244
+ ],
245
+ [
246
+ 3,
247
+ 3,
248
+ 3
249
+ ],
250
+ [
251
+ 3,
252
+ 3,
253
+ 3
254
+ ]
255
+ ],
256
+ "unet_max_num_features": 320,
257
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
258
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
259
+ "resampling_fn_data_kwargs": {
260
+ "is_seg": false,
261
+ "order": 3,
262
+ "order_z": 0,
263
+ "force_separate_z": null
264
+ },
265
+ "resampling_fn_seg_kwargs": {
266
+ "is_seg": true,
267
+ "order": 1,
268
+ "order_z": 0,
269
+ "force_separate_z": null
270
+ },
271
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
272
+ "resampling_fn_probabilities_kwargs": {
273
+ "is_seg": false,
274
+ "order": 1,
275
+ "order_z": 0,
276
+ "force_separate_z": null
277
+ },
278
+ "batch_dice": false
279
+ }
280
+ },
281
+ "experiment_planner_used": "ExperimentPlanner",
282
+ "label_manager": "LabelManager",
283
+ "foreground_intensity_properties_per_channel": {
284
+ "0": {
285
+ "max": 5805.0,
286
+ "mean": 64.62580871582031,
287
+ "median": 76.0,
288
+ "min": -2048.0,
289
+ "percentile_00_5": -981.9942016601562,
290
+ "percentile_99_5": 1093.9758911132812,
291
+ "std": 140.14614868164062
292
+ }
293
+ }
294
+ }
output_images/predict_from_raw_data_args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "folder_with_segs_from_prev_stage": null,
3
+ "list_of_lists_or_source_folder": [
4
+ [
5
+ "./input_images/img0027_0000.nii.gz"
6
+ ]
7
+ ],
8
+ "num_parts": 1,
9
+ "num_processes_preprocessing": 2,
10
+ "num_processes_segmentation_export": 2,
11
+ "output_folder_or_list_of_truncated_output_files": [
12
+ "./output_images/img0027_pred.nii.gz"
13
+ ],
14
+ "overwrite": false,
15
+ "part_id": 0,
16
+ "save_probabilities": false
17
+ }