Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions fmriprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,31 @@ def init_spaces(checkpoint=True):
cifti_output = workflow.cifti_output
if cifti_output:
# CIFTI grayordinates to corresponding FSL-MNI resolutions.
vol_res = '2' if cifti_output == '91k' else '1'
spaces.add(Reference('MNI152NLin6Asym', {'res': vol_res}))
res = '2' if cifti_output == '91k' else '1'
den = '32k' if cifti_output == '91k' else '59k'
spaces.add(Reference('fsLR', {'den': den, 'volspace': 'MNI152NLin6Asym', 'volres': res}))

if spaces.get_spaces(cifti=(True,)):
# Figure out the surface spaces and volume spaces we need
cifti_spaces = spaces.get_standard(cifti=(True,)) + spaces.get_nonstandard(cifti=(True,))
for cifti_space in cifti_spaces:
# The surface space
spaces.add(
Reference(
cifti_space.space,
{k: v for k, v in cifti_space.spec.items() if not k.startswith('vol')},
),
)
# The volume space
spaces.add(
Reference(
cifti_space.spec['volspace'],
{
k: v for k, v in cifti_space.spec.items()
if (k.startswith('vol') and k != 'volspace')
},
),
)

# Make the SpatialReferences object available
workflow.spaces = spaces
2 changes: 1 addition & 1 deletion fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def init_bold_wf(
name='carpetplot_wf',
)

if config.workflow.cifti_output:
if spaces.get_spaces(cifti=(True,)):
workflow.connect(
bold_grayords_wf, 'outputnode.cifti_bold', carpetplot_wf, 'inputnode.cifti_bold',
) # fmt:skip
Expand Down