Skip to content

Commit 0a88fd9

Browse files
committed
ENH: Add each surface / morphometric as a standalone output
1 parent a223a2f commit 0a88fd9

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

smriprep/workflows/surfaces.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,23 +574,51 @@ def init_gifti_surface_wf(*, name="gifti_surface_wf"):
574574
575575
Outputs
576576
-------
577+
midthickness
578+
Left and right midthickness (or graymid) surface GIFTIs
579+
pial
580+
Left and right pial surface GIFTIs
581+
white
582+
Left and right white surface GIFTIs
583+
inflated
584+
Left and right inflated surface GIFTIs
577585
surfaces
578586
GIFTI surfaces for gray/white matter boundary, pial surface,
579587
midthickness (or graymid) surface, and inflated surfaces
588+
thickness
589+
Left and right cortical thickness GIFTIs
590+
sulc
591+
Left and right sulcal depth map GIFTIs
592+
curv
593+
Left and right curvature map GIFTIs
580594
morphometrics
581595
GIFTIs of cortical thickness, curvature, and sulcal depth
582596
583597
"""
584598
from ..interfaces.freesurfer import MRIsConvertData
585-
from ..interfaces.surf import NormalizeSurf
599+
from ..interfaces.surf import NormalizeSurf, AggregateSurfaces
586600

587601
workflow = Workflow(name=name)
588602

589603
inputnode = pe.Node(
590604
niu.IdentityInterface(["subjects_dir", "subject_id", "fsnative2t1w_xfm"]),
591605
name="inputnode",
592606
)
593-
outputnode = pe.Node(niu.IdentityInterface(["surfaces", "morphometrics"]), name="outputnode")
607+
outputnode = pe.Node(
608+
niu.IdentityInterface([
609+
"pial",
610+
"white",
611+
"inflated",
612+
"midthickness",
613+
"thickness",
614+
"sulc",
615+
"curv",
616+
# Preserve grouping
617+
"surfaces",
618+
"morphometrics",
619+
]),
620+
name="outputnode"
621+
)
594622

595623
get_surfaces = pe.Node(nio.FreeSurferSource(), name="get_surfaces")
596624

@@ -624,6 +652,8 @@ def init_gifti_surface_wf(*, name="gifti_surface_wf"):
624652
name="morphs2gii",
625653
)
626654

655+
agg_surfaces = pe.Node(AggregateSurfaces(), name="agg_surfaces")
656+
627657
# fmt:off
628658
workflow.connect([
629659
(inputnode, get_surfaces, [('subjects_dir', 'subjects_dir'),
@@ -648,6 +678,16 @@ def init_gifti_surface_wf(*, name="gifti_surface_wf"):
648678
('curv', 'in3')]),
649679
(surfmorph_list, morphs2gii, [('out', 'scalarcurv_file')]),
650680
(morphs2gii, outputnode, [('converted', 'morphometrics')]),
681+
# Output individual surfaces as well
682+
(fix_surfs, agg_surfaces, [('out_file', 'surfaces')]),
683+
(morphs2gii, agg_surfaces, [('converted', 'morphometrics')]),
684+
(agg_surfaces, outputnode, [('pial', 'pial'),
685+
('white', 'white'),
686+
('inflated', 'inflated'),
687+
('midthickness', 'midthickness'),
688+
('thickness', 'thickness'),
689+
('sulc', 'sulc'),
690+
('curv', 'curv')]),
651691
])
652692
# fmt:on
653693
return workflow

0 commit comments

Comments
 (0)