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