@@ -574,7 +574,12 @@ class CreateSurfaceROIOutputSpec(TraitedSpec):
574
574
575
575
576
576
class CreateSurfaceROI (SimpleInterface ):
577
- """Prepare GIFTI shape file for use in"""
577
+ """Prepare GIFTI shape file for use in cortical masking
578
+
579
+ Distilled from the FreeSurfer2CaretConvertAndRegisterNonlinear.sh script in
580
+ DCAN-HCP PostFreeSurfer scripts (as of commit 9291324). The relevant lines
581
+ are 277-290.
582
+ """
578
583
579
584
input_spec = CreateSurfaceROIInputSpec
580
585
output_spec = CreateSurfaceROIOutputSpec
@@ -584,15 +589,15 @@ def _run_interface(self, runtime):
584
589
if not isdefined (subject ):
585
590
subject = 'sub-XYZ'
586
591
img = nb .GiftiImage .from_filename (self .inputs .thickness_file )
587
- # wb_command -set-structure
592
+ # wb_command -set-structure (L282)
588
593
img .meta ["AnatomicalStructurePrimary" ] = {'L' : 'CortexLeft' , 'R' : 'CortexRight' }[hemi ]
589
594
darray = img .darrays [0 ]
590
- # wb_command -set-map-names
595
+ # wb_command -set-map-names (L284)
591
596
meta = darray .meta
592
597
meta ['Name' ] = f"{ subject } _{ hemi } _ROI"
593
- # wb_command -metric-palette calls have no effect on ROI files
598
+ # wb_command -metric-palette calls (L285, L289) have no effect on ROI files
594
599
595
- # Compiling an odd sequence of math operations that works out to:
600
+ # Compiling an odd sequence of math operations (L283, L288, L290) that work out to:
596
601
# wb_command -metric-math "abs(var * -1) > 0"
597
602
roi = np .abs (darray .data ) > 0
598
603
0 commit comments