@@ -225,46 +225,86 @@ class CAT12SegmentInputSpec(SPMCommandInputSpec):
225
225
" are not available as batch dependencies objects. "
226
226
)
227
227
surface_and_thickness_estimation = traits .Int (
228
- 1 , field = "surface" , desc = _help_surf , usedefault = True
228
+ 1 , field = "output. surface" , desc = _help_surf , usedefault = True
229
229
)
230
230
surface_measures = traits .Int (
231
231
1 ,
232
232
field = "output.surf_measures" ,
233
- usedefault = True ,
233
+ # usedefault=True,
234
234
desc = "Extract surface measures" ,
235
+ # requires=["neuromorphometrics", "lpba40", "cobra", "hammers", "thalamus", "thalamic_nuclei", "suit", "ibsr"],
236
+ # xor=["noROI"],
235
237
)
236
238
237
239
# Templates
238
240
neuromorphometrics = traits .Bool (
239
241
True ,
240
242
field = "output.ROImenu.atlases.neuromorphometrics" ,
241
- usedefault = True ,
243
+ # usedefault=True,
242
244
desc = "Extract brain measures for Neuromorphometrics template" ,
245
+ xor = ["noROI" ],
243
246
)
244
247
lpba40 = traits .Bool (
245
248
True ,
246
249
field = "output.ROImenu.atlases.lpba40" ,
247
- usedefault = True ,
250
+ # usedefault=True,
248
251
desc = "Extract brain measures for LPBA40 template" ,
252
+ xor = ["noROI" ],
249
253
)
250
254
cobra = traits .Bool (
251
255
True ,
252
256
field = "output.ROImenu.atlases.hammers" ,
253
- usedefault = True ,
257
+ # usedefault=True,
254
258
desc = "Extract brain measures for COBRA template" ,
259
+ xor = ["noROI" ],
255
260
)
256
261
hammers = traits .Bool (
257
- True ,
262
+ False ,
258
263
field = "output.ROImenu.atlases.cobra" ,
259
- usedefault = True ,
264
+ # usedefault=True,
260
265
desc = "Extract brain measures for Hammers template" ,
266
+ xor = ["noROI" ],
267
+ )
268
+ thalamus = traits .Bool (
269
+ True ,
270
+ field = "output.ROImenu.atlases.thalamus" ,
271
+ # usedefault=True,
272
+ desc = "Extract brain measures for Thalamus template" ,
273
+ xor = ["noROI" ],
274
+ )
275
+ thalamic_nuclei = traits .Bool (
276
+ True ,
277
+ field = "output.ROImenu.atlases.thalamaic_nuclei" ,
278
+ # usedefault=True,
279
+ desc = "Extract brain measures for Thalamic Nuclei template" ,
280
+ xor = ["noROI" ],
281
+ )
282
+ suit = traits .Bool (
283
+ True ,
284
+ field = "output.ROImenu.atlases.suit" ,
285
+ # usedefault=True,
286
+ desc = "Extract brain measures for Suit template" ,
287
+ xor = ["noROI" ],
288
+ )
289
+ ibsr = traits .Bool (
290
+ False ,
291
+ field = "output.ROImenu.atlases.ibsr" ,
292
+ # usedefault=True,
293
+ desc = "Extract brain measures for IBSR template" ,
294
+ xor = ["noROI" ],
261
295
)
262
296
own_atlas = InputMultiPath (
263
297
ImageFileSPM (exists = True ),
264
298
field = "output.ROImenu.atlases.ownatlas" ,
265
299
desc = "Extract brain measures for a given template" ,
266
300
mandatory = False ,
267
301
copyfile = False ,
302
+ xor = ["noROI" ],
303
+ )
304
+ noROI = traits .Bool (
305
+ field = "output.ROImenu.noROI" ,
306
+ desc = "Select if no ROI analysis needed" ,
307
+ xor = ["neuromorphometrics" , "lpba40" , "cobra" , "hammers" , "thalamus" , "thalamic_nuclei" , "suit" , "ibsr" ],
268
308
)
269
309
270
310
# Grey matter
@@ -524,13 +564,6 @@ def _format_arg(self, opt, spec, val):
524
564
return scans_for_fname (val )
525
565
elif opt in ["tpm" , "shooting_tpm" ]:
526
566
return Cell2Str (val )
527
-
528
- if opt == "surface_measures" :
529
- if not self .inputs .surface_measures :
530
- self .inputs .neuromorphometrics = False
531
- self .inputs .lpba40 = False
532
- self .inputs .cobra = False
533
- self .inputs .hammers = False
534
567
535
568
return super ()._format_arg (opt , spec , val )
536
569
@@ -560,22 +593,22 @@ def _list_outputs(self):
560
593
561
594
if self .inputs .save_bias_corrected :
562
595
outputs ["bias_corrected_image" ] = fname_presuffix (
563
- f , prefix = os .path .join ("mri" , "wmi " )
596
+ f , prefix = os .path .join ("mri" , "wm " )
564
597
)
565
598
566
- outputs [ "surface_files" ] = [
567
- str ( surf ) for surf in Path ( pth ). glob ( "surf/*" ) if surf . is_file ()
568
- ]
569
-
570
- for hemisphere in ["rh" , "lh" ]:
571
- for suffix in ["central" , "sphere" ]:
572
- outfield = f"{ hemisphere } _{ suffix } _surface"
573
- outputs [outfield ] = fname_presuffix (
574
- f ,
575
- prefix = os .path .join ("surf" , f"{ hemisphere } .{ suffix } ." ),
576
- suffix = ".gii" ,
577
- use_ext = False ,
578
- )
599
+ if self . inputs . surface_and_thickness_estimation :
600
+ outputs [ "surface_files" ] = [
601
+ str ( surf ) for surf in Path ( pth ). glob ( "surf/*" ) if surf . is_file ()
602
+ ]
603
+ for hemisphere in ["rh" , "lh" ]:
604
+ for suffix in ["central" , "sphere" ]:
605
+ outfield = f"{ hemisphere } _{ suffix } _surface"
606
+ outputs [outfield ] = fname_presuffix (
607
+ f ,
608
+ prefix = os .path .join ("surf" , f"{ hemisphere } .{ suffix } ." ),
609
+ suffix = ".gii" ,
610
+ use_ext = False ,
611
+ )
579
612
580
613
outputs ["report_files" ] = outputs ["report_files" ] = [
581
614
str (report ) for report in Path (pth ).glob ("report/*" ) if report .is_file ()
@@ -589,11 +622,10 @@ def _list_outputs(self):
589
622
str (label ) for label in Path (pth ).glob ("label/*" ) if label .is_file ()
590
623
]
591
624
592
- if self .inputs .surface_measures :
625
+ if self .inputs .noROI :
593
626
outputs ["label_rois" ] = fname_presuffix (
594
627
f , prefix = os .path .join ("label" , "catROIs_" ), suffix = ".xml" , use_ext = False
595
628
)
596
- else :
597
629
outputs ["label_roi" ] = fname_presuffix (
598
630
f , prefix = os .path .join ("label" , "catROI_" ), suffix = ".xml" , use_ext = False
599
631
)
0 commit comments