Skip to content

Commit a266d90

Browse files
authored
[FIX] Make sure --cifti-output requires at least one of fsaverage{5,6}
Fixes nipreps/niworkflows#309
1 parent 4470ffb commit a266d90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fmriprep/workflows/bold/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
365365
tr=metadata.get("RepetitionTime")),
366366
name='summary', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True)
367367

368+
# CIfTI output: currently, we only support fsaverage{5,6}
369+
cifti_spaces = [s for s in surface_spaces if s in ('fsaverage5', 'fsaverage6')]
370+
cifti_output = cifti_output and cifti_spaces
368371
func_derivatives_wf = init_func_derivatives_wf(output_dir=output_dir,
369372
output_spaces=output_spaces,
370373
template=template,
@@ -798,17 +801,15 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
798801
(bold_surf_wf, outputnode, [('outputnode.surfaces', 'surfaces')]),
799802
])
800803

801-
# CIFTI output
802-
if cifti_output and surface_spaces:
804+
if cifti_output:
803805
bold_surf_wf.__desc__ += """\
804806
*Grayordinates* files [@hcppipelines], which combine surface-sampled
805807
data and volume-sampled data, were also generated.
806808
"""
807809
gen_cifti = pe.MapNode(GenerateCifti(), iterfield=["surface_target", "gifti_files"],
808810
name="gen_cifti")
809811
gen_cifti.inputs.TR = metadata.get("RepetitionTime")
810-
gen_cifti.inputs.surface_target = [s for s in surface_spaces
811-
if s.startswith('fsaverage')]
812+
gen_cifti.inputs.surface_target = cifti_spaces
812813

813814
workflow.connect([
814815
(bold_surf_wf, gen_cifti, [

0 commit comments

Comments
 (0)