garridojuan commited on
Commit
350adcd
·
verified ·
1 Parent(s): d90be96

Add nnU-Net EVAR models

Browse files
Files changed (29) hide show
  1. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json +12 -0
  2. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth +3 -0
  3. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth +3 -0
  4. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth +3 -0
  5. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth +3 -0
  6. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth +3 -0
  7. Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json +444 -0
  8. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json +17 -0
  9. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth +3 -0
  10. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth +3 -0
  11. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth +3 -0
  12. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth +3 -0
  13. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth +3 -0
  14. Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json +304 -0
  15. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json +13 -0
  16. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth +3 -0
  17. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth +3 -0
  18. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth +3 -0
  19. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth +3 -0
  20. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth +3 -0
  21. Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json +454 -0
  22. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json +20 -0
  23. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth +3 -0
  24. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth +3 -0
  25. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth +3 -0
  26. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth +3 -0
  27. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth +3 -0
  28. Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json +304 -0
  29. formatting_models.py +350 -0
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "CT"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "aorta": 1,
8
+ "thrombus": 2
9
+ },
10
+ "numTraining": 142,
11
+ "file_ending": ".nii.gz"
12
+ }
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbc6296c03cfe82cd6233cc9c2fe4bb6c182d90c236f4e434903f84e8b289b34
3
+ size 246789282
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d39bad1713bc9a17ea77f37ccd18039118bd91285284f595e1ca1a1b8f89b548
3
+ size 246814882
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88a572b1b0badc09c9ecadac437354c41fd468da4d3eab1dc89bf469e1104409
3
+ size 246801762
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b14ea9d04087920388dcf590da551cbb0e47887554126a497dfd394a9c5155e
3
+ size 246826850
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:795a7059b6e9b8ae19d7493b545a54f38525c1410e474eecb2aeb35dc2361598
3
+ size 246823714
Dataset100_SegmentationPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json ADDED
@@ -0,0 +1,444 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset100_SegmentationPreEVAR",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 0.794921875,
6
+ 0.699999988079071,
7
+ 0.794921875
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 512,
11
+ 676,
12
+ 512
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 1,
17
+ 0,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 1,
22
+ 0,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 13,
30
+ "patch_size": [
31
+ 576,
32
+ 448
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 640.5,
36
+ 512.0
37
+ ],
38
+ "spacing": [
39
+ 0.699999988079071,
40
+ 0.794921875
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
+ 2
58
+ ],
59
+ "n_conv_per_stage_decoder": [
60
+ 2,
61
+ 2,
62
+ 2,
63
+ 2,
64
+ 2,
65
+ 2
66
+ ],
67
+ "num_pool_per_axis": [
68
+ 6,
69
+ 6
70
+ ],
71
+ "pool_op_kernel_sizes": [
72
+ [
73
+ 1,
74
+ 1
75
+ ],
76
+ [
77
+ 2,
78
+ 2
79
+ ],
80
+ [
81
+ 2,
82
+ 2
83
+ ],
84
+ [
85
+ 2,
86
+ 2
87
+ ],
88
+ [
89
+ 2,
90
+ 2
91
+ ],
92
+ [
93
+ 2,
94
+ 2
95
+ ],
96
+ [
97
+ 2,
98
+ 2
99
+ ]
100
+ ],
101
+ "conv_kernel_sizes": [
102
+ [
103
+ 3,
104
+ 3
105
+ ],
106
+ [
107
+ 3,
108
+ 3
109
+ ],
110
+ [
111
+ 3,
112
+ 3
113
+ ],
114
+ [
115
+ 3,
116
+ 3
117
+ ],
118
+ [
119
+ 3,
120
+ 3
121
+ ],
122
+ [
123
+ 3,
124
+ 3
125
+ ],
126
+ [
127
+ 3,
128
+ 3
129
+ ]
130
+ ],
131
+ "unet_max_num_features": 512,
132
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
133
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
134
+ "resampling_fn_data_kwargs": {
135
+ "is_seg": false,
136
+ "order": 3,
137
+ "order_z": 0,
138
+ "force_separate_z": null
139
+ },
140
+ "resampling_fn_seg_kwargs": {
141
+ "is_seg": true,
142
+ "order": 1,
143
+ "order_z": 0,
144
+ "force_separate_z": null
145
+ },
146
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
147
+ "resampling_fn_probabilities_kwargs": {
148
+ "is_seg": false,
149
+ "order": 1,
150
+ "order_z": 0,
151
+ "force_separate_z": null
152
+ },
153
+ "batch_dice": true
154
+ },
155
+ "3d_lowres": {
156
+ "data_identifier": "nnUNetPlans_3d_lowres",
157
+ "preprocessor_name": "DefaultPreprocessor",
158
+ "batch_size": 2,
159
+ "patch_size": [
160
+ 128,
161
+ 160,
162
+ 112
163
+ ],
164
+ "median_image_size_in_voxels": [
165
+ 187,
166
+ 234,
167
+ 187
168
+ ],
169
+ "spacing": [
170
+ 2.1716512798263263,
171
+ 1.9123336742875865,
172
+ 2.1716512798263263
173
+ ],
174
+ "normalization_schemes": [
175
+ "CTNormalization"
176
+ ],
177
+ "use_mask_for_norm": [
178
+ false
179
+ ],
180
+ "UNet_class_name": "PlainConvUNet",
181
+ "UNet_base_num_features": 32,
182
+ "n_conv_per_stage_encoder": [
183
+ 2,
184
+ 2,
185
+ 2,
186
+ 2,
187
+ 2,
188
+ 2
189
+ ],
190
+ "n_conv_per_stage_decoder": [
191
+ 2,
192
+ 2,
193
+ 2,
194
+ 2,
195
+ 2
196
+ ],
197
+ "num_pool_per_axis": [
198
+ 5,
199
+ 5,
200
+ 4
201
+ ],
202
+ "pool_op_kernel_sizes": [
203
+ [
204
+ 1,
205
+ 1,
206
+ 1
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
+ 2,
225
+ 2,
226
+ 2
227
+ ],
228
+ [
229
+ 2,
230
+ 2,
231
+ 1
232
+ ]
233
+ ],
234
+ "conv_kernel_sizes": [
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
+ 3,
257
+ 3,
258
+ 3
259
+ ],
260
+ [
261
+ 3,
262
+ 3,
263
+ 3
264
+ ]
265
+ ],
266
+ "unet_max_num_features": 320,
267
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
268
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
269
+ "resampling_fn_data_kwargs": {
270
+ "is_seg": false,
271
+ "order": 3,
272
+ "order_z": 0,
273
+ "force_separate_z": null
274
+ },
275
+ "resampling_fn_seg_kwargs": {
276
+ "is_seg": true,
277
+ "order": 1,
278
+ "order_z": 0,
279
+ "force_separate_z": null
280
+ },
281
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
282
+ "resampling_fn_probabilities_kwargs": {
283
+ "is_seg": false,
284
+ "order": 1,
285
+ "order_z": 0,
286
+ "force_separate_z": null
287
+ },
288
+ "batch_dice": false,
289
+ "next_stage": "3d_cascade_fullres"
290
+ },
291
+ "3d_fullres": {
292
+ "data_identifier": "nnUNetPlans_3d_fullres",
293
+ "preprocessor_name": "DefaultPreprocessor",
294
+ "batch_size": 2,
295
+ "patch_size": [
296
+ 128,
297
+ 160,
298
+ 112
299
+ ],
300
+ "median_image_size_in_voxels": [
301
+ 512.0,
302
+ 640.5,
303
+ 512.0
304
+ ],
305
+ "spacing": [
306
+ 0.794921875,
307
+ 0.699999988079071,
308
+ 0.794921875
309
+ ],
310
+ "normalization_schemes": [
311
+ "CTNormalization"
312
+ ],
313
+ "use_mask_for_norm": [
314
+ false
315
+ ],
316
+ "UNet_class_name": "PlainConvUNet",
317
+ "UNet_base_num_features": 32,
318
+ "n_conv_per_stage_encoder": [
319
+ 2,
320
+ 2,
321
+ 2,
322
+ 2,
323
+ 2,
324
+ 2
325
+ ],
326
+ "n_conv_per_stage_decoder": [
327
+ 2,
328
+ 2,
329
+ 2,
330
+ 2,
331
+ 2
332
+ ],
333
+ "num_pool_per_axis": [
334
+ 5,
335
+ 5,
336
+ 4
337
+ ],
338
+ "pool_op_kernel_sizes": [
339
+ [
340
+ 1,
341
+ 1,
342
+ 1
343
+ ],
344
+ [
345
+ 2,
346
+ 2,
347
+ 2
348
+ ],
349
+ [
350
+ 2,
351
+ 2,
352
+ 2
353
+ ],
354
+ [
355
+ 2,
356
+ 2,
357
+ 2
358
+ ],
359
+ [
360
+ 2,
361
+ 2,
362
+ 2
363
+ ],
364
+ [
365
+ 2,
366
+ 2,
367
+ 1
368
+ ]
369
+ ],
370
+ "conv_kernel_sizes": [
371
+ [
372
+ 3,
373
+ 3,
374
+ 3
375
+ ],
376
+ [
377
+ 3,
378
+ 3,
379
+ 3
380
+ ],
381
+ [
382
+ 3,
383
+ 3,
384
+ 3
385
+ ],
386
+ [
387
+ 3,
388
+ 3,
389
+ 3
390
+ ],
391
+ [
392
+ 3,
393
+ 3,
394
+ 3
395
+ ],
396
+ [
397
+ 3,
398
+ 3,
399
+ 3
400
+ ]
401
+ ],
402
+ "unet_max_num_features": 320,
403
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
404
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
405
+ "resampling_fn_data_kwargs": {
406
+ "is_seg": false,
407
+ "order": 3,
408
+ "order_z": 0,
409
+ "force_separate_z": null
410
+ },
411
+ "resampling_fn_seg_kwargs": {
412
+ "is_seg": true,
413
+ "order": 1,
414
+ "order_z": 0,
415
+ "force_separate_z": null
416
+ },
417
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
418
+ "resampling_fn_probabilities_kwargs": {
419
+ "is_seg": false,
420
+ "order": 1,
421
+ "order_z": 0,
422
+ "force_separate_z": null
423
+ },
424
+ "batch_dice": true
425
+ },
426
+ "3d_cascade_fullres": {
427
+ "inherits_from": "3d_fullres",
428
+ "previous_stage": "3d_lowres"
429
+ }
430
+ },
431
+ "experiment_planner_used": "ExperimentPlanner",
432
+ "label_manager": "LabelManager",
433
+ "foreground_intensity_properties_per_channel": {
434
+ "0": {
435
+ "max": 3019.0,
436
+ "mean": 224.7982940673828,
437
+ "median": 226.0,
438
+ "min": -1027.0,
439
+ "percentile_00_5": -61.0,
440
+ "percentile_99_5": 733.0,
441
+ "std": 171.99642944335938
442
+ }
443
+ }
444
+ }
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "CT"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "aorta": 1,
8
+ "CeliacTrunk": 2,
9
+ "SupMesenteric": 3,
10
+ "Renal": 4,
11
+ "IniAneu": 5,
12
+ "AorticBifurcation": 6,
13
+ "EndAneu": 7
14
+ },
15
+ "numTraining": 142,
16
+ "file_ending": ".nii.gz"
17
+ }
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3be879188f920513e4271baf527f5d4b161f24ae8d91fd696cf3bc968df96f0
3
+ size 245538914
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:855e1599ac6cc4cfea517c0c6be300af0c00fb43bf461c60e2c5d86dab75a759
3
+ size 245547554
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a71bb7a7fe75338c78f6ad5e0b2b396bc10df10cdb02c42376c02a65ff54b4e0
3
+ size 244879010
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab80311a6f40713748458b12c708f2f513c3f667e8b7e0d85b8ccb2ab86c8dd0
3
+ size 245492066
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5f530281110da18cf8c4ae50514fe4bf87f57779be204efff25f4a2fd42f175
3
+ size 245549538
Dataset101_LandmarksPreEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset101_LandmarksPreEVAR",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 0.794921875,
6
+ 0.699999988079071,
7
+ 0.794921875
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 149,
11
+ 382,
12
+ 158
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 1,
17
+ 0,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 1,
22
+ 0,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 52,
30
+ "patch_size": [
31
+ 384,
32
+ 160
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 372.0,
36
+ 154.0
37
+ ],
38
+ "spacing": [
39
+ 0.699999988079071,
40
+ 0.794921875
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
+ 2
58
+ ],
59
+ "n_conv_per_stage_decoder": [
60
+ 2,
61
+ 2,
62
+ 2,
63
+ 2,
64
+ 2,
65
+ 2
66
+ ],
67
+ "num_pool_per_axis": [
68
+ 6,
69
+ 5
70
+ ],
71
+ "pool_op_kernel_sizes": [
72
+ [
73
+ 1,
74
+ 1
75
+ ],
76
+ [
77
+ 2,
78
+ 2
79
+ ],
80
+ [
81
+ 2,
82
+ 2
83
+ ],
84
+ [
85
+ 2,
86
+ 2
87
+ ],
88
+ [
89
+ 2,
90
+ 2
91
+ ],
92
+ [
93
+ 2,
94
+ 2
95
+ ],
96
+ [
97
+ 2,
98
+ 1
99
+ ]
100
+ ],
101
+ "conv_kernel_sizes": [
102
+ [
103
+ 3,
104
+ 3
105
+ ],
106
+ [
107
+ 3,
108
+ 3
109
+ ],
110
+ [
111
+ 3,
112
+ 3
113
+ ],
114
+ [
115
+ 3,
116
+ 3
117
+ ],
118
+ [
119
+ 3,
120
+ 3
121
+ ],
122
+ [
123
+ 3,
124
+ 3
125
+ ],
126
+ [
127
+ 3,
128
+ 3
129
+ ]
130
+ ],
131
+ "unet_max_num_features": 512,
132
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
133
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
134
+ "resampling_fn_data_kwargs": {
135
+ "is_seg": false,
136
+ "order": 3,
137
+ "order_z": 0,
138
+ "force_separate_z": null
139
+ },
140
+ "resampling_fn_seg_kwargs": {
141
+ "is_seg": true,
142
+ "order": 1,
143
+ "order_z": 0,
144
+ "force_separate_z": null
145
+ },
146
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
147
+ "resampling_fn_probabilities_kwargs": {
148
+ "is_seg": false,
149
+ "order": 1,
150
+ "order_z": 0,
151
+ "force_separate_z": null
152
+ },
153
+ "batch_dice": true
154
+ },
155
+ "3d_fullres": {
156
+ "data_identifier": "nnUNetPlans_3d_fullres",
157
+ "preprocessor_name": "DefaultPreprocessor",
158
+ "batch_size": 2,
159
+ "patch_size": [
160
+ 96,
161
+ 256,
162
+ 96
163
+ ],
164
+ "median_image_size_in_voxels": [
165
+ 145.0,
166
+ 372.0,
167
+ 154.0
168
+ ],
169
+ "spacing": [
170
+ 0.794921875,
171
+ 0.699999988079071,
172
+ 0.794921875
173
+ ],
174
+ "normalization_schemes": [
175
+ "CTNormalization"
176
+ ],
177
+ "use_mask_for_norm": [
178
+ false
179
+ ],
180
+ "UNet_class_name": "PlainConvUNet",
181
+ "UNet_base_num_features": 32,
182
+ "n_conv_per_stage_encoder": [
183
+ 2,
184
+ 2,
185
+ 2,
186
+ 2,
187
+ 2,
188
+ 2
189
+ ],
190
+ "n_conv_per_stage_decoder": [
191
+ 2,
192
+ 2,
193
+ 2,
194
+ 2,
195
+ 2
196
+ ],
197
+ "num_pool_per_axis": [
198
+ 4,
199
+ 5,
200
+ 4
201
+ ],
202
+ "pool_op_kernel_sizes": [
203
+ [
204
+ 1,
205
+ 1,
206
+ 1
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
+ 2,
225
+ 2,
226
+ 2
227
+ ],
228
+ [
229
+ 1,
230
+ 2,
231
+ 1
232
+ ]
233
+ ],
234
+ "conv_kernel_sizes": [
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
+ 3,
257
+ 3,
258
+ 3
259
+ ],
260
+ [
261
+ 3,
262
+ 3,
263
+ 3
264
+ ]
265
+ ],
266
+ "unet_max_num_features": 320,
267
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
268
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
269
+ "resampling_fn_data_kwargs": {
270
+ "is_seg": false,
271
+ "order": 3,
272
+ "order_z": 0,
273
+ "force_separate_z": null
274
+ },
275
+ "resampling_fn_seg_kwargs": {
276
+ "is_seg": true,
277
+ "order": 1,
278
+ "order_z": 0,
279
+ "force_separate_z": null
280
+ },
281
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
282
+ "resampling_fn_probabilities_kwargs": {
283
+ "is_seg": false,
284
+ "order": 1,
285
+ "order_z": 0,
286
+ "force_separate_z": null
287
+ },
288
+ "batch_dice": false
289
+ }
290
+ },
291
+ "experiment_planner_used": "ExperimentPlanner",
292
+ "label_manager": "LabelManager",
293
+ "foreground_intensity_properties_per_channel": {
294
+ "0": {
295
+ "max": 3021.0263671875,
296
+ "mean": 225.3034210205078,
297
+ "median": 226.00135803222656,
298
+ "min": -614.0191040039062,
299
+ "percentile_00_5": -55.998077392578125,
300
+ "percentile_99_5": 734.02587890625,
301
+ "std": 171.73367309570312
302
+ }
303
+ }
304
+ }
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "CT"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "aorticLumen": 1,
8
+ "ExAorta": 2,
9
+ "endoleak": 3
10
+ },
11
+ "numTraining": 167,
12
+ "file_ending": ".nii.gz"
13
+ }
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:298e22b8716dbc5a29baa6e0428ede6bea4be915f7fcfb4cdd5341070f6f5c28
3
+ size 250151266
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:488f65e95318341162cb7aa2d7817d53b6b5588e2ef449219859b26e7d1713f5
3
+ size 250130338
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0626c07c4bd2c0711df687c87d0d8426b792cee7eb336d15fca7e96667c471fe
3
+ size 250144098
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b1054da2f19006464ac19d58573bd542f24fb8001b3cdb551b4a9a8d21e1a77
3
+ size 250174050
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e6e5984c09cc323fa7ef734fbda22766770a22ee3261431a18e0a9116febff5
3
+ size 250135330
Dataset200_SegmentationPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset200_SegmentationPostEVAR",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 0.76953125,
6
+ 0.699999988079071,
7
+ 0.76953125
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 512,
11
+ 608,
12
+ 512
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 1,
17
+ 0,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 1,
22
+ 0,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 12,
30
+ "patch_size": [
31
+ 512,
32
+ 512
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 591.0,
36
+ 512.0
37
+ ],
38
+ "spacing": [
39
+ 0.699999988079071,
40
+ 0.76953125
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
+ 2,
58
+ 2
59
+ ],
60
+ "n_conv_per_stage_decoder": [
61
+ 2,
62
+ 2,
63
+ 2,
64
+ 2,
65
+ 2,
66
+ 2,
67
+ 2
68
+ ],
69
+ "num_pool_per_axis": [
70
+ 7,
71
+ 7
72
+ ],
73
+ "pool_op_kernel_sizes": [
74
+ [
75
+ 1,
76
+ 1
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
+ 2,
96
+ 2
97
+ ],
98
+ [
99
+ 2,
100
+ 2
101
+ ],
102
+ [
103
+ 2,
104
+ 2
105
+ ]
106
+ ],
107
+ "conv_kernel_sizes": [
108
+ [
109
+ 3,
110
+ 3
111
+ ],
112
+ [
113
+ 3,
114
+ 3
115
+ ],
116
+ [
117
+ 3,
118
+ 3
119
+ ],
120
+ [
121
+ 3,
122
+ 3
123
+ ],
124
+ [
125
+ 3,
126
+ 3
127
+ ],
128
+ [
129
+ 3,
130
+ 3
131
+ ],
132
+ [
133
+ 3,
134
+ 3
135
+ ],
136
+ [
137
+ 3,
138
+ 3
139
+ ]
140
+ ],
141
+ "unet_max_num_features": 512,
142
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
143
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
144
+ "resampling_fn_data_kwargs": {
145
+ "is_seg": false,
146
+ "order": 3,
147
+ "order_z": 0,
148
+ "force_separate_z": null
149
+ },
150
+ "resampling_fn_seg_kwargs": {
151
+ "is_seg": true,
152
+ "order": 1,
153
+ "order_z": 0,
154
+ "force_separate_z": null
155
+ },
156
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
157
+ "resampling_fn_probabilities_kwargs": {
158
+ "is_seg": false,
159
+ "order": 1,
160
+ "order_z": 0,
161
+ "force_separate_z": null
162
+ },
163
+ "batch_dice": true
164
+ },
165
+ "3d_lowres": {
166
+ "data_identifier": "nnUNetPlans_3d_lowres",
167
+ "preprocessor_name": "DefaultPreprocessor",
168
+ "batch_size": 2,
169
+ "patch_size": [
170
+ 128,
171
+ 128,
172
+ 128
173
+ ],
174
+ "median_image_size_in_voxels": [
175
+ 193,
176
+ 223,
177
+ 193
178
+ ],
179
+ "spacing": [
180
+ 2.0410548513908835,
181
+ 1.8566346352306664,
182
+ 2.0410548513908835
183
+ ],
184
+ "normalization_schemes": [
185
+ "CTNormalization"
186
+ ],
187
+ "use_mask_for_norm": [
188
+ false
189
+ ],
190
+ "UNet_class_name": "PlainConvUNet",
191
+ "UNet_base_num_features": 32,
192
+ "n_conv_per_stage_encoder": [
193
+ 2,
194
+ 2,
195
+ 2,
196
+ 2,
197
+ 2,
198
+ 2
199
+ ],
200
+ "n_conv_per_stage_decoder": [
201
+ 2,
202
+ 2,
203
+ 2,
204
+ 2,
205
+ 2
206
+ ],
207
+ "num_pool_per_axis": [
208
+ 5,
209
+ 5,
210
+ 5
211
+ ],
212
+ "pool_op_kernel_sizes": [
213
+ [
214
+ 1,
215
+ 1,
216
+ 1
217
+ ],
218
+ [
219
+ 2,
220
+ 2,
221
+ 2
222
+ ],
223
+ [
224
+ 2,
225
+ 2,
226
+ 2
227
+ ],
228
+ [
229
+ 2,
230
+ 2,
231
+ 2
232
+ ],
233
+ [
234
+ 2,
235
+ 2,
236
+ 2
237
+ ],
238
+ [
239
+ 2,
240
+ 2,
241
+ 2
242
+ ]
243
+ ],
244
+ "conv_kernel_sizes": [
245
+ [
246
+ 3,
247
+ 3,
248
+ 3
249
+ ],
250
+ [
251
+ 3,
252
+ 3,
253
+ 3
254
+ ],
255
+ [
256
+ 3,
257
+ 3,
258
+ 3
259
+ ],
260
+ [
261
+ 3,
262
+ 3,
263
+ 3
264
+ ],
265
+ [
266
+ 3,
267
+ 3,
268
+ 3
269
+ ],
270
+ [
271
+ 3,
272
+ 3,
273
+ 3
274
+ ]
275
+ ],
276
+ "unet_max_num_features": 320,
277
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
278
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
279
+ "resampling_fn_data_kwargs": {
280
+ "is_seg": false,
281
+ "order": 3,
282
+ "order_z": 0,
283
+ "force_separate_z": null
284
+ },
285
+ "resampling_fn_seg_kwargs": {
286
+ "is_seg": true,
287
+ "order": 1,
288
+ "order_z": 0,
289
+ "force_separate_z": null
290
+ },
291
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
292
+ "resampling_fn_probabilities_kwargs": {
293
+ "is_seg": false,
294
+ "order": 1,
295
+ "order_z": 0,
296
+ "force_separate_z": null
297
+ },
298
+ "batch_dice": false,
299
+ "next_stage": "3d_cascade_fullres"
300
+ },
301
+ "3d_fullres": {
302
+ "data_identifier": "nnUNetPlans_3d_fullres",
303
+ "preprocessor_name": "DefaultPreprocessor",
304
+ "batch_size": 2,
305
+ "patch_size": [
306
+ 128,
307
+ 128,
308
+ 128
309
+ ],
310
+ "median_image_size_in_voxels": [
311
+ 512.0,
312
+ 591.0,
313
+ 512.0
314
+ ],
315
+ "spacing": [
316
+ 0.76953125,
317
+ 0.699999988079071,
318
+ 0.76953125
319
+ ],
320
+ "normalization_schemes": [
321
+ "CTNormalization"
322
+ ],
323
+ "use_mask_for_norm": [
324
+ false
325
+ ],
326
+ "UNet_class_name": "PlainConvUNet",
327
+ "UNet_base_num_features": 32,
328
+ "n_conv_per_stage_encoder": [
329
+ 2,
330
+ 2,
331
+ 2,
332
+ 2,
333
+ 2,
334
+ 2
335
+ ],
336
+ "n_conv_per_stage_decoder": [
337
+ 2,
338
+ 2,
339
+ 2,
340
+ 2,
341
+ 2
342
+ ],
343
+ "num_pool_per_axis": [
344
+ 5,
345
+ 5,
346
+ 5
347
+ ],
348
+ "pool_op_kernel_sizes": [
349
+ [
350
+ 1,
351
+ 1,
352
+ 1
353
+ ],
354
+ [
355
+ 2,
356
+ 2,
357
+ 2
358
+ ],
359
+ [
360
+ 2,
361
+ 2,
362
+ 2
363
+ ],
364
+ [
365
+ 2,
366
+ 2,
367
+ 2
368
+ ],
369
+ [
370
+ 2,
371
+ 2,
372
+ 2
373
+ ],
374
+ [
375
+ 2,
376
+ 2,
377
+ 2
378
+ ]
379
+ ],
380
+ "conv_kernel_sizes": [
381
+ [
382
+ 3,
383
+ 3,
384
+ 3
385
+ ],
386
+ [
387
+ 3,
388
+ 3,
389
+ 3
390
+ ],
391
+ [
392
+ 3,
393
+ 3,
394
+ 3
395
+ ],
396
+ [
397
+ 3,
398
+ 3,
399
+ 3
400
+ ],
401
+ [
402
+ 3,
403
+ 3,
404
+ 3
405
+ ],
406
+ [
407
+ 3,
408
+ 3,
409
+ 3
410
+ ]
411
+ ],
412
+ "unet_max_num_features": 320,
413
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
414
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
415
+ "resampling_fn_data_kwargs": {
416
+ "is_seg": false,
417
+ "order": 3,
418
+ "order_z": 0,
419
+ "force_separate_z": null
420
+ },
421
+ "resampling_fn_seg_kwargs": {
422
+ "is_seg": true,
423
+ "order": 1,
424
+ "order_z": 0,
425
+ "force_separate_z": null
426
+ },
427
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
428
+ "resampling_fn_probabilities_kwargs": {
429
+ "is_seg": false,
430
+ "order": 1,
431
+ "order_z": 0,
432
+ "force_separate_z": null
433
+ },
434
+ "batch_dice": true
435
+ },
436
+ "3d_cascade_fullres": {
437
+ "inherits_from": "3d_fullres",
438
+ "previous_stage": "3d_lowres"
439
+ }
440
+ },
441
+ "experiment_planner_used": "ExperimentPlanner",
442
+ "label_manager": "LabelManager",
443
+ "foreground_intensity_properties_per_channel": {
444
+ "0": {
445
+ "max": 6219.0,
446
+ "mean": 176.33143615722656,
447
+ "median": 92.0,
448
+ "min": -1039.0,
449
+ "percentile_00_5": -114.0,
450
+ "percentile_99_5": 1052.9691162109375,
451
+ "std": 219.0260009765625
452
+ }
453
+ }
454
+ }
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/dataset.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "channel_names": {
3
+ "0": "CT"
4
+ },
5
+ "labels": {
6
+ "background": 0,
7
+ "aorta": 1,
8
+ "CeliacTrunk": 2,
9
+ "SupMesenteric": 3,
10
+ "Renal": 4,
11
+ "IniAneu": 5,
12
+ "AorticBifurcation": 6,
13
+ "EndAneu": 7,
14
+ "IniP": 8,
15
+ "IniP2": 9,
16
+ "EndP": 10
17
+ },
18
+ "numTraining": 167,
19
+ "file_ending": ".nii.gz"
20
+ }
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_0/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:285aa8d28cdbe2bc89c75bf16986b5e4990f513985e4cef6260f4e439dfc50e6
3
+ size 245759714
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_1/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:826142199593bb4dfa9d29f9db66748293381ac068810afbc5c8fdd7dda768c7
3
+ size 245756642
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_2/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb19d473678894652f4e3e516c91f87068f8360977fa2c168902af546bd912fa
3
+ size 245690082
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_3/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:722a4cd0b5cf03f174bba95a49f483db84125a1d49cf4bc2a219e9a59e39c2ec
3
+ size 245767842
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/fold_4/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2065577995a2ea92651e1adf518addc8604232576097bd45b68657e9756e649c
3
+ size 244988386
Dataset201_LandmarksPostEVAR/nnUNetTrainer__nnUNetPlans__3d_fullres/plans.json ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "Dataset201_LandmarksPostEVAR",
3
+ "plans_name": "nnUNetPlans",
4
+ "original_median_spacing_after_transp": [
5
+ 0.76953125,
6
+ 0.699999988079071,
7
+ 0.76953125
8
+ ],
9
+ "original_median_shape_after_transp": [
10
+ 147,
11
+ 366,
12
+ 157
13
+ ],
14
+ "image_reader_writer": "SimpleITKIO",
15
+ "transpose_forward": [
16
+ 1,
17
+ 0,
18
+ 2
19
+ ],
20
+ "transpose_backward": [
21
+ 1,
22
+ 0,
23
+ 2
24
+ ],
25
+ "configurations": {
26
+ "2d": {
27
+ "data_identifier": "nnUNetPlans_2d",
28
+ "preprocessor_name": "DefaultPreprocessor",
29
+ "batch_size": 51,
30
+ "patch_size": [
31
+ 384,
32
+ 160
33
+ ],
34
+ "median_image_size_in_voxels": [
35
+ 364.0,
36
+ 158.0
37
+ ],
38
+ "spacing": [
39
+ 0.699999988079071,
40
+ 0.76953125
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
+ 2
58
+ ],
59
+ "n_conv_per_stage_decoder": [
60
+ 2,
61
+ 2,
62
+ 2,
63
+ 2,
64
+ 2,
65
+ 2
66
+ ],
67
+ "num_pool_per_axis": [
68
+ 6,
69
+ 5
70
+ ],
71
+ "pool_op_kernel_sizes": [
72
+ [
73
+ 1,
74
+ 1
75
+ ],
76
+ [
77
+ 2,
78
+ 2
79
+ ],
80
+ [
81
+ 2,
82
+ 2
83
+ ],
84
+ [
85
+ 2,
86
+ 2
87
+ ],
88
+ [
89
+ 2,
90
+ 2
91
+ ],
92
+ [
93
+ 2,
94
+ 2
95
+ ],
96
+ [
97
+ 2,
98
+ 1
99
+ ]
100
+ ],
101
+ "conv_kernel_sizes": [
102
+ [
103
+ 3,
104
+ 3
105
+ ],
106
+ [
107
+ 3,
108
+ 3
109
+ ],
110
+ [
111
+ 3,
112
+ 3
113
+ ],
114
+ [
115
+ 3,
116
+ 3
117
+ ],
118
+ [
119
+ 3,
120
+ 3
121
+ ],
122
+ [
123
+ 3,
124
+ 3
125
+ ],
126
+ [
127
+ 3,
128
+ 3
129
+ ]
130
+ ],
131
+ "unet_max_num_features": 512,
132
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
133
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
134
+ "resampling_fn_data_kwargs": {
135
+ "is_seg": false,
136
+ "order": 3,
137
+ "order_z": 0,
138
+ "force_separate_z": null
139
+ },
140
+ "resampling_fn_seg_kwargs": {
141
+ "is_seg": true,
142
+ "order": 1,
143
+ "order_z": 0,
144
+ "force_separate_z": null
145
+ },
146
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
147
+ "resampling_fn_probabilities_kwargs": {
148
+ "is_seg": false,
149
+ "order": 1,
150
+ "order_z": 0,
151
+ "force_separate_z": null
152
+ },
153
+ "batch_dice": true
154
+ },
155
+ "3d_fullres": {
156
+ "data_identifier": "nnUNetPlans_3d_fullres",
157
+ "preprocessor_name": "DefaultPreprocessor",
158
+ "batch_size": 2,
159
+ "patch_size": [
160
+ 96,
161
+ 256,
162
+ 96
163
+ ],
164
+ "median_image_size_in_voxels": [
165
+ 142.0,
166
+ 364.0,
167
+ 158.0
168
+ ],
169
+ "spacing": [
170
+ 0.76953125,
171
+ 0.699999988079071,
172
+ 0.76953125
173
+ ],
174
+ "normalization_schemes": [
175
+ "CTNormalization"
176
+ ],
177
+ "use_mask_for_norm": [
178
+ false
179
+ ],
180
+ "UNet_class_name": "PlainConvUNet",
181
+ "UNet_base_num_features": 32,
182
+ "n_conv_per_stage_encoder": [
183
+ 2,
184
+ 2,
185
+ 2,
186
+ 2,
187
+ 2,
188
+ 2
189
+ ],
190
+ "n_conv_per_stage_decoder": [
191
+ 2,
192
+ 2,
193
+ 2,
194
+ 2,
195
+ 2
196
+ ],
197
+ "num_pool_per_axis": [
198
+ 4,
199
+ 5,
200
+ 4
201
+ ],
202
+ "pool_op_kernel_sizes": [
203
+ [
204
+ 1,
205
+ 1,
206
+ 1
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
+ 2,
225
+ 2,
226
+ 2
227
+ ],
228
+ [
229
+ 1,
230
+ 2,
231
+ 1
232
+ ]
233
+ ],
234
+ "conv_kernel_sizes": [
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
+ 3,
257
+ 3,
258
+ 3
259
+ ],
260
+ [
261
+ 3,
262
+ 3,
263
+ 3
264
+ ]
265
+ ],
266
+ "unet_max_num_features": 320,
267
+ "resampling_fn_data": "resample_data_or_seg_to_shape",
268
+ "resampling_fn_seg": "resample_data_or_seg_to_shape",
269
+ "resampling_fn_data_kwargs": {
270
+ "is_seg": false,
271
+ "order": 3,
272
+ "order_z": 0,
273
+ "force_separate_z": null
274
+ },
275
+ "resampling_fn_seg_kwargs": {
276
+ "is_seg": true,
277
+ "order": 1,
278
+ "order_z": 0,
279
+ "force_separate_z": null
280
+ },
281
+ "resampling_fn_probabilities": "resample_data_or_seg_to_shape",
282
+ "resampling_fn_probabilities_kwargs": {
283
+ "is_seg": false,
284
+ "order": 1,
285
+ "order_z": 0,
286
+ "force_separate_z": null
287
+ },
288
+ "batch_dice": false
289
+ }
290
+ },
291
+ "experiment_planner_used": "ExperimentPlanner",
292
+ "label_manager": "LabelManager",
293
+ "foreground_intensity_properties_per_channel": {
294
+ "0": {
295
+ "max": 8273.0732421875,
296
+ "mean": 198.3298797607422,
297
+ "median": 100.0,
298
+ "min": -1031.0211181640625,
299
+ "percentile_00_5": -98.02599334716797,
300
+ "percentile_99_5": 1471.9705810546875,
301
+ "std": 258.0361633300781
302
+ }
303
+ }
304
+ }
formatting_models.py ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ import json
3
+ import shutil
4
+ import torch
5
+ import re
6
+
7
+ SOURCE_ROOT = Path(r"\\NAS3_Z\all\Juan\Documents\MATLAB\AutoAGM\AutoAGM_files\pythonfiles\folders\nnunet_results")
8
+ DEST_ROOT = Path(r"\\NAS3_Z\all\Juan\EVARAI\HuggingFace_models")
9
+
10
+ DATASETS = {
11
+ "Dataset370_PreInterventionV3": "Dataset100_SegmentationPreEVAR",
12
+ "Dataset380_LandmarksPreInterventionV2": "Dataset101_LandmarksPreEVAR",
13
+ "Dataset371_PostInterventionV3": "Dataset200_SegmentationPostEVAR",
14
+ "Dataset381_LandmarksPostInterventionV2": "Dataset201_LandmarksPostEVAR",
15
+ }
16
+
17
+
18
+
19
+ OVERWRITE = True
20
+
21
+
22
+ def get_dataset_id(name):
23
+ match = re.match(r"Dataset(\d{3})_", name)
24
+ if not match:
25
+ raise ValueError(f"Nombre de dataset no válido: {name}")
26
+ return int(match.group(1))
27
+
28
+
29
+ def normalize_key(key):
30
+ return str(key).lower().replace("-", "_").replace(" ", "_")
31
+
32
+
33
+ def is_dataset_id_key(key):
34
+ key = normalize_key(key)
35
+ return key in {"dataset_id", "datasetid", "dataset_name_or_id"} or key.endswith("_dataset_id")
36
+
37
+
38
+ def is_dataset_name_key(key):
39
+ key = normalize_key(key)
40
+ return key == "dataset_name" or key.endswith("_dataset_name")
41
+
42
+
43
+ def load_checkpoint(path):
44
+ try:
45
+ return torch.load(path, map_location="cpu", weights_only=False)
46
+ except TypeError:
47
+ return torch.load(path, map_location="cpu")
48
+
49
+
50
+ def find_dataset_references(obj, old_name, old_id, path="root", parent_key=None):
51
+ """Busca referencias al nombre/ID antiguo sin modificar nada."""
52
+ found = []
53
+
54
+ if isinstance(obj, dict):
55
+ for key, value in obj.items():
56
+ current_path = f"{path}.{key}"
57
+
58
+ if isinstance(key, str) and (old_name in key or f"Dataset{old_id:03d}" in key):
59
+ found.append((current_path + " [KEY]", key))
60
+
61
+ # No tiene sentido recorrer millones de parámetros
62
+ if key == "network_weights":
63
+ continue
64
+
65
+ found.extend(find_dataset_references(value, old_name, old_id, current_path, key))
66
+
67
+ elif isinstance(obj, (list, tuple)):
68
+ for i, value in enumerate(obj):
69
+ found.extend(find_dataset_references(value, old_name, old_id, f"{path}[{i}]", parent_key))
70
+
71
+ elif isinstance(obj, str):
72
+ if old_name in obj or f"Dataset{old_id:03d}" in obj:
73
+ found.append((path, obj))
74
+ elif parent_key is not None and is_dataset_id_key(parent_key) and obj == str(old_id):
75
+ found.append((path, obj))
76
+
77
+ elif isinstance(obj, int) and not isinstance(obj, bool):
78
+ if parent_key is not None and is_dataset_id_key(parent_key) and obj == old_id:
79
+ found.append((path, obj))
80
+
81
+ return found
82
+
83
+
84
+ def rewrite_metadata(obj, old_name, new_name, old_id, new_id, parent_key=None):
85
+ """
86
+ Cambia únicamente referencias identificables del dataset.
87
+ No hace un reemplazo global old_id -> new_id.
88
+ """
89
+ if isinstance(obj, dict):
90
+ result = {}
91
+
92
+ for key, value in obj.items():
93
+ new_key = key
94
+
95
+ if isinstance(key, str):
96
+ new_key = key.replace(old_name, new_name)
97
+
98
+ if new_key == "network_weights":
99
+ result[new_key] = value
100
+ continue
101
+
102
+ result[new_key] = rewrite_metadata(value, old_name, new_name, old_id, new_id, new_key)
103
+
104
+ return result
105
+
106
+ if isinstance(obj, list):
107
+ return [rewrite_metadata(v, old_name, new_name, old_id, new_id, parent_key) for v in obj]
108
+
109
+ if isinstance(obj, tuple):
110
+ return tuple(rewrite_metadata(v, old_name, new_name, old_id, new_id, parent_key) for v in obj)
111
+
112
+ if isinstance(obj, str):
113
+ value = obj.replace(old_name, new_name)
114
+
115
+ if parent_key is not None and is_dataset_name_key(parent_key):
116
+ if value.startswith(f"Dataset{old_id:03d}_") or value == f"Dataset{old_id:03d}":
117
+ value = new_name
118
+
119
+ if parent_key is not None and is_dataset_id_key(parent_key) and value == str(old_id):
120
+ value = str(new_id)
121
+
122
+ return value
123
+
124
+ if isinstance(obj, int) and not isinstance(obj, bool):
125
+ if parent_key is not None and is_dataset_id_key(parent_key) and obj == old_id:
126
+ return new_id
127
+
128
+ return obj
129
+
130
+
131
+ def verify_weights_identical(original, modified):
132
+ """Comprueba que network_weights no ha cambiado."""
133
+ if "network_weights" not in original or "network_weights" not in modified:
134
+ raise RuntimeError("El checkpoint no contiene 'network_weights'.")
135
+
136
+ weights_a = original["network_weights"]
137
+ weights_b = modified["network_weights"]
138
+
139
+ if weights_a.keys() != weights_b.keys():
140
+ raise RuntimeError("Las claves de network_weights han cambiado.")
141
+
142
+ for key in weights_a:
143
+ a, b = weights_a[key], weights_b[key]
144
+
145
+ if torch.is_tensor(a) and torch.is_tensor(b):
146
+ if not torch.equal(a, b):
147
+ raise RuntimeError(f"Los pesos han cambiado en: {key}")
148
+ elif a != b:
149
+ raise RuntimeError(f"Ha cambiado un elemento de network_weights: {key}")
150
+
151
+
152
+ def audit_json(path, old_name, old_id):
153
+ with open(path, "r", encoding="utf-8") as f:
154
+ data = json.load(f)
155
+
156
+ return find_dataset_references(data, old_name, old_id, path.name)
157
+
158
+
159
+ def audit_checkpoint(path, old_name, old_id):
160
+ checkpoint = load_checkpoint(path)
161
+ return find_dataset_references(checkpoint, old_name, old_id, path.name)
162
+
163
+
164
+ def save_modified_json(src, dst, old_name, new_name, old_id, new_id):
165
+ with open(src, "r", encoding="utf-8") as f:
166
+ data = json.load(f)
167
+
168
+ data = rewrite_metadata(data, old_name, new_name, old_id, new_id)
169
+
170
+ dst.parent.mkdir(parents=True, exist_ok=True)
171
+
172
+ with open(dst, "w", encoding="utf-8") as f:
173
+ json.dump(data, f, indent=4, ensure_ascii=False)
174
+
175
+
176
+ def save_modified_checkpoint(src, dst, old_name, new_name, old_id, new_id):
177
+ checkpoint = load_checkpoint(src)
178
+
179
+ # Guardamos una referencia a los pesos originales.
180
+ original_weights = checkpoint["network_weights"]
181
+
182
+ # Modificamos todos los metadatos excepto network_weights.
183
+ modified = rewrite_metadata(checkpoint, old_name, new_name, old_id, new_id)
184
+
185
+ # Comprobación antes de guardar.
186
+ verify_weights_identical({"network_weights": original_weights}, modified)
187
+
188
+ dst.parent.mkdir(parents=True, exist_ok=True)
189
+ torch.save(modified, dst)
190
+
191
+ # Volvemos a cargar el archivo generado y comprobamos de nuevo.
192
+ reloaded = load_checkpoint(dst)
193
+ verify_weights_identical({"network_weights": original_weights}, reloaded)
194
+
195
+
196
+ def find_trainer_dirs(dataset_dir):
197
+ trainers = []
198
+
199
+ for plans_file in dataset_dir.rglob("plans.json"):
200
+ trainer_dir = plans_file.parent
201
+
202
+ if (trainer_dir / "dataset.json").exists() and any(trainer_dir.glob("fold_*")):
203
+ trainers.append(trainer_dir)
204
+
205
+ return sorted(set(trainers))
206
+
207
+
208
+ def print_references(refs, indent=" "):
209
+ if not refs:
210
+ print(f"{indent}No se encontraron referencias.")
211
+ return
212
+
213
+ for path, value in refs:
214
+ value = str(value)
215
+ if len(value) > 150:
216
+ value = value[:147] + "..."
217
+ print(f"{indent}{path}: {value}")
218
+
219
+
220
+ def export_dataset(old_name, new_name):
221
+ old_id = get_dataset_id(old_name)
222
+ new_id = get_dataset_id(new_name)
223
+
224
+ src_dataset = SOURCE_ROOT / old_name
225
+ dst_dataset = DEST_ROOT / new_name
226
+
227
+ print("\n" + "=" * 80)
228
+ print(f"{old_name} -> {new_name}")
229
+ print(f"ID: {old_id} -> {new_id}")
230
+
231
+ if not src_dataset.exists():
232
+ raise FileNotFoundError(f"No existe: {src_dataset}")
233
+
234
+ if dst_dataset.exists() and not OVERWRITE:
235
+ raise FileExistsError(
236
+ f"Ya existe {dst_dataset}. Bórralo o cambia OVERWRITE = True."
237
+ )
238
+
239
+ if dst_dataset.exists() and OVERWRITE:
240
+ shutil.rmtree(dst_dataset)
241
+
242
+ trainer_dirs = find_trainer_dirs(src_dataset)
243
+
244
+ if not trainer_dirs:
245
+ raise RuntimeError(f"No se encontraron trainers dentro de {src_dataset}")
246
+
247
+ for trainer_dir in trainer_dirs:
248
+ relative = trainer_dir.relative_to(src_dataset)
249
+ dst_trainer = dst_dataset / relative
250
+
251
+ print(f"\n Trainer: {relative}")
252
+
253
+ # ------------------------------------------------------------------
254
+ # AUDITORÍA ORIGINAL
255
+ # ------------------------------------------------------------------
256
+
257
+ for filename in ("dataset.json", "plans.json"):
258
+ src = trainer_dir / filename
259
+
260
+ print(f"\n Auditoría {filename}:")
261
+ refs = audit_json(src, old_name, old_id)
262
+ print_references(refs)
263
+
264
+ save_modified_json(
265
+ src, dst_trainer / filename,
266
+ old_name, new_name, old_id, new_id
267
+ )
268
+
269
+ # ------------------------------------------------------------------
270
+ # FOLDS
271
+ # ------------------------------------------------------------------
272
+
273
+ fold_dirs = sorted(
274
+ [p for p in trainer_dir.glob("fold_*") if p.is_dir()],
275
+ key=lambda p: p.name
276
+ )
277
+
278
+ for fold_dir in fold_dirs:
279
+ checkpoint = fold_dir / "checkpoint_best.pth"
280
+
281
+ if not checkpoint.exists():
282
+ print(f"\n [WARNING] {fold_dir.name}: no existe checkpoint_best.pth")
283
+ continue
284
+
285
+ print(f"\n Auditoría {fold_dir.name}/checkpoint_best.pth:")
286
+
287
+ refs = audit_checkpoint(checkpoint, old_name, old_id)
288
+ print_references(refs)
289
+
290
+ dst_checkpoint = dst_trainer / fold_dir.name / "checkpoint_best.pth"
291
+
292
+ save_modified_checkpoint(
293
+ checkpoint, dst_checkpoint,
294
+ old_name, new_name, old_id, new_id
295
+ )
296
+
297
+ print(" ✓ checkpoint copiado")
298
+ print(" ✓ metadatos actualizados")
299
+ print(" ✓ network_weights idénticos")
300
+
301
+ # ------------------------------------------------------------------
302
+ # AUDITORÍA FINAL
303
+ # ------------------------------------------------------------------
304
+
305
+ print("\n Comprobación final...")
306
+
307
+ residual_refs = []
308
+
309
+ for filename in ("dataset.json", "plans.json"):
310
+ residual_refs.extend(
311
+ audit_json(dst_trainer / filename, old_name, old_id)
312
+ )
313
+
314
+ for checkpoint in dst_trainer.glob("fold_*/checkpoint_best.pth"):
315
+ residual_refs.extend(
316
+ audit_checkpoint(checkpoint, old_name, old_id)
317
+ )
318
+
319
+ if residual_refs:
320
+ print("\n [ERROR] Quedan referencias al dataset antiguo:")
321
+ print_references(residual_refs)
322
+ raise RuntimeError(
323
+ f"La exportación de {old_name} contiene referencias antiguas."
324
+ )
325
+
326
+ print(" ✓ No quedan referencias al nombre/ID antiguo.")
327
+
328
+
329
+ def main():
330
+ if not SOURCE_ROOT.exists():
331
+ raise FileNotFoundError(f"No existe SOURCE_ROOT: {SOURCE_ROOT}")
332
+
333
+ DEST_ROOT.mkdir(parents=True, exist_ok=True)
334
+
335
+ print("SOURCE:", SOURCE_ROOT)
336
+ print("DEST: ", DEST_ROOT)
337
+
338
+ for old_name, new_name in DATASETS.items():
339
+ export_dataset(old_name, new_name)
340
+
341
+ print("\n" + "=" * 80)
342
+ print("EXPORTACIÓN COMPLETADA")
343
+ print("=" * 80)
344
+
345
+ for new_name in DATASETS.values():
346
+ print(f" {DEST_ROOT / new_name}")
347
+
348
+
349
+ if __name__ == "__main__":
350
+ main()