Skip to content

Commit e57a953

Browse files
committed
Output fsLR meshes on subject surfaces
Implementation of nipreps/fmriprep#3411.
1 parent a2dc27d commit e57a953

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

aslprep/workflows/base.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ def init_single_subject_wf(subject_id: str):
128128
from smriprep.workflows.outputs import (
129129
init_ds_anat_volumes_wf,
130130
init_ds_grayord_metrics_wf,
131+
init_ds_surfaces_wf,
131132
init_template_iterator_wf,
132133
)
133134
from smriprep.workflows.surfaces import (
134135
init_gifti_morphometrics_wf,
135136
init_hcp_morphometrics_wf,
136137
init_morph_grayords_wf,
137-
init_resample_midthickness_wf,
138+
init_resample_surfaces_wf,
138139
)
139140

140141
from aslprep.interfaces.bids import BIDSDataGrabber
@@ -422,7 +423,8 @@ def init_single_subject_wf(subject_id: str):
422423
grayord_density=config.workflow.cifti_output,
423424
omp_nthreads=omp_nthreads,
424425
)
425-
resample_midthickness_wf = init_resample_midthickness_wf(
426+
resample_surfaces_wf = init_resample_surfaces_wf(
427+
surfaces=['white', 'pial', 'midthickness'],
426428
grayord_density=config.workflow.cifti_output,
427429
)
428430
ds_grayord_metrics_wf = init_ds_grayord_metrics_wf(
@@ -431,6 +433,15 @@ def init_single_subject_wf(subject_id: str):
431433
metrics=['curv', 'thickness', 'sulc'],
432434
cifti_output=config.workflow.cifti_output,
433435
)
436+
ds_fsLR_surfaces_wf = init_ds_surfaces_wf(
437+
output_dir=aslprep_dir,
438+
surfaces=['white', 'pial', 'midthickness'],
439+
entities={
440+
'space': 'fsLR',
441+
'density': '32k' if config.workflow.cifti_output == '91k' else '59k',
442+
},
443+
name='ds_fsLR_surfaces_wf',
444+
)
434445

435446
workflow.connect([
436447
(anat_fit_wf, curv_wf, [
@@ -446,7 +457,9 @@ def init_single_subject_wf(subject_id: str):
446457
(curv_wf, hcp_morphometrics_wf, [
447458
('outputnode.curv', 'inputnode.curv'),
448459
]),
449-
(anat_fit_wf, resample_midthickness_wf, [
460+
(anat_fit_wf, resample_surfaces_wf, [
461+
('outputnode.white', 'inputnode.white'),
462+
('outputnode.pial', 'inputnode.pial'),
450463
('outputnode.midthickness', 'inputnode.midthickness'),
451464
(
452465
f"outputnode.sphere_reg_{'msm' if msm_sulc else 'fsLR'}",
@@ -466,12 +479,15 @@ def init_single_subject_wf(subject_id: str):
466479
('outputnode.sulc', 'inputnode.sulc'),
467480
('outputnode.roi', 'inputnode.roi'),
468481
]),
469-
(resample_midthickness_wf, morph_grayords_wf, [
482+
(resample_surfaces_wf, morph_grayords_wf, [
470483
('outputnode.midthickness_fsLR', 'inputnode.midthickness_fsLR'),
471484
]),
472485
(anat_fit_wf, ds_grayord_metrics_wf, [
473486
('outputnode.t1w_valid_list', 'inputnode.source_files'),
474487
]),
488+
(anat_fit_wf, ds_fsLR_surfaces_wf, [
489+
('outputnode.t1w_valid_list', 'inputnode.source_files'),
490+
]),
475491
(morph_grayords_wf, ds_grayord_metrics_wf, [
476492
('outputnode.curv_fsLR', 'inputnode.curv'),
477493
('outputnode.curv_metadata', 'inputnode.curv_metadata'),
@@ -480,6 +496,11 @@ def init_single_subject_wf(subject_id: str):
480496
('outputnode.sulc_fsLR', 'inputnode.sulc'),
481497
('outputnode.sulc_metadata', 'inputnode.sulc_metadata'),
482498
]),
499+
(resample_surfaces_wf, ds_fsLR_surfaces_wf, [
500+
('outputnode.white_fsLR', 'inputnode.white'),
501+
('outputnode.pial_fsLR', 'inputnode.pial'),
502+
('outputnode.midthickness_fsLR', 'inputnode.midthickness'),
503+
]),
483504
]) # fmt:skip
484505

485506
if config.workflow.anat_only:
@@ -713,7 +734,7 @@ def init_single_subject_wf(subject_id: str):
713734
(select_MNI6_xfm, asl_wf, [('anat2std_xfm', 'inputnode.anat2mni6_xfm')]),
714735
(select_MNI6_tpl, asl_wf, [('brain_mask', 'inputnode.mni6_mask')]),
715736
(hcp_morphometrics_wf, asl_wf, [('outputnode.roi', 'inputnode.cortex_mask')]),
716-
(resample_midthickness_wf, asl_wf, [
737+
(resample_surfaces_wf, asl_wf, [
717738
('outputnode.midthickness_fsLR', 'inputnode.midthickness_fsLR'),
718739
]),
719740
]) # fmt:skip

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
"requests",
3737
"sdcflows <= 2.11.0",
3838
"sentry-sdk <= 2.19.2",
39-
"smriprep <= 0.16.1",
39+
"smriprep <= 0.17.0",
4040
"templateflow <= 24.2.2",
4141
"toml",
4242
]

0 commit comments

Comments
 (0)