Skip to content

Commit f4ac201

Browse files
mgxdeffigies
andauthored
Apply suggestions from code review
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 3b570d0 commit f4ac201

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

niworkflows/interfaces/surf.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,12 @@ class CreateSurfaceROIOutputSpec(TraitedSpec):
574574

575575

576576
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+
"""
578583

579584
input_spec = CreateSurfaceROIInputSpec
580585
output_spec = CreateSurfaceROIOutputSpec
@@ -584,15 +589,15 @@ def _run_interface(self, runtime):
584589
if not isdefined(subject):
585590
subject = 'sub-XYZ'
586591
img = nb.GiftiImage.from_filename(self.inputs.thickness_file)
587-
# wb_command -set-structure
592+
# wb_command -set-structure (L282)
588593
img.meta["AnatomicalStructurePrimary"] = {'L': 'CortexLeft', 'R': 'CortexRight'}[hemi]
589594
darray = img.darrays[0]
590-
# wb_command -set-map-names
595+
# wb_command -set-map-names (L284)
591596
meta = darray.meta
592597
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
594599

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:
596601
# wb_command -metric-math "abs(var * -1) > 0"
597602
roi = np.abs(darray.data) > 0
598603

0 commit comments

Comments
 (0)