Skip to content

Commit 3b5b230

Browse files
committed
RF: Switch to more targeted morphometry datasinks
1 parent b49ac4c commit 3b5b230

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

smriprep/workflows/anatomical.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ def init_anat_preproc_wf(
312312
ds_surfaces_wf = init_ds_surfaces_wf(
313313
bids_root=bids_root, output_dir=output_dir, surfaces=["inflated"]
314314
)
315+
ds_curv_wf = init_ds_surface_metrics_wf(
316+
bids_root=bids_root, output_dir=output_dir, metrics=["curv"], name="ds_curv_wf"
317+
)
315318

316319
# fmt:off
317320
workflow.connect([
@@ -320,18 +323,20 @@ def init_anat_preproc_wf(
320323
('outputnode.subjects_dir', 'inputnode.subjects_dir'),
321324
('outputnode.subject_id', 'inputnode.subject_id'),
322325
('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm'),
323-
# Just for collation. These can probably go away at some point.
324-
('outputnode.thickness', 'inputnode.thickness'),
325-
('outputnode.sulc', 'inputnode.sulc'),
326326
]),
327327
(anat_fit_wf, ds_surfaces_wf, [
328328
('outputnode.t1w_valid_list', 'inputnode.source_files'),
329329
]),
330330
(surface_derivatives_wf, ds_surfaces_wf, [
331331
('outputnode.inflated', 'inputnode.inflated'),
332332
]),
333+
(anat_fit_wf, ds_curv_wf, [
334+
('outputnode.t1w_valid_list', 'inputnode.source_files'),
335+
]),
336+
(surface_derivatives_wf, ds_curv_wf, [
337+
('outputnode.curv', 'inputnode.curv'),
338+
]),
333339
(surface_derivatives_wf, anat_second_derivatives_wf, [
334-
('outputnode.morphometrics', 'inputnode.morphometrics'),
335340
('outputnode.out_aseg', 'inputnode.t1w_fs_aseg'),
336341
('outputnode.out_aparc', 'inputnode.t1w_fs_aparc'),
337342
('outputnode.cifti_morph', 'inputnode.cifti_morph'),

smriprep/workflows/outputs.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ def init_anat_second_derivatives_wf(
876876
"anat2std_xfm",
877877
"sphere_reg",
878878
"sphere_reg_fsLR",
879-
"morphometrics",
880879
"t1w_fs_aseg",
881880
"t1w_fs_aparc",
882881
"cifti_morph",
@@ -1011,22 +1010,6 @@ def init_anat_second_derivatives_wf(
10111010
if not freesurfer:
10121011
return workflow
10131012

1014-
from niworkflows.interfaces.surf import Path2BIDS
1015-
1016-
# Morphometrics
1017-
name_morphs = pe.MapNode(
1018-
Path2BIDS(),
1019-
iterfield="in_file",
1020-
name="name_morphs",
1021-
run_without_submitting=True,
1022-
)
1023-
ds_morphs = pe.MapNode(
1024-
DerivativesDataSink(base_directory=output_dir, extension=".shape.gii"),
1025-
iterfield=["in_file", "hemi", "suffix"],
1026-
name="ds_morphs",
1027-
run_without_submitting=True,
1028-
)
1029-
10301013
# Parcellations
10311014
ds_t1w_fsaseg = pe.Node(
10321015
DerivativesDataSink(base_directory=output_dir, desc="aseg", suffix="dseg", compress=True),
@@ -1043,11 +1026,6 @@ def init_anat_second_derivatives_wf(
10431026

10441027
# fmt:off
10451028
workflow.connect([
1046-
(inputnode, name_morphs, [('morphometrics', 'in_file')]),
1047-
(inputnode, ds_morphs, [('morphometrics', 'in_file'),
1048-
('source_files', 'source_file')]),
1049-
(name_morphs, ds_morphs, [('hemi', 'hemi'),
1050-
('suffix', 'suffix')]),
10511029
(inputnode, ds_t1w_fsaseg, [('t1w_fs_aseg', 'in_file'),
10521030
('source_files', 'source_file')]),
10531031
(inputnode, ds_t1w_fsparc, [('t1w_fs_aparc', 'in_file'),

smriprep/workflows/surfaces.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,6 @@ def init_surface_derivatives_wf(
630630
"subject_id",
631631
"fsnative2t1w_xfm",
632632
"reference",
633-
"thickness",
634-
"sulc",
635633
]
636634
),
637635
name="inputnode",
@@ -640,7 +638,7 @@ def init_surface_derivatives_wf(
640638
niu.IdentityInterface(
641639
fields=[
642640
"inflated",
643-
"morphometrics",
641+
"curv",
644642
"out_aseg",
645643
"out_aparc",
646644
"cifti_morph",
@@ -655,8 +653,6 @@ def init_surface_derivatives_wf(
655653
aseg_to_native_wf = init_segs_to_native_wf()
656654
aparc_to_native_wf = init_segs_to_native_wf(segmentation="aparc_aseg")
657655

658-
all_morph = pe.Node(niu.Merge(3), name="all_morph")
659-
660656
# fmt:off
661657
workflow.connect([
662658
# Configuration
@@ -682,15 +678,11 @@ def init_surface_derivatives_wf(
682678
('fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm'),
683679
]),
684680

685-
# Collate morphometry from inputnode and workflows
686-
(inputnode, all_morph, [('thickness', 'in1'), ('sulc', 'in2')]),
687-
(gifti_morph_wf, all_morph, [('outputnode.curv', 'in3')]),
688-
689681
# Output
690682
(gifti_surfaces_wf, outputnode, [('outputnode.inflated', 'inflated')]),
691683
(aseg_to_native_wf, outputnode, [('outputnode.out_file', 'out_aseg')]),
692684
(aparc_to_native_wf, outputnode, [('outputnode.out_file', 'out_aparc')]),
693-
(all_morph, outputnode, [('out', 'morphometrics')]),
685+
(gifti_morph_wf, outputnode, [('outputnode.curv', 'curv')]),
694686
])
695687
# fmt:on
696688

0 commit comments

Comments
 (0)