Skip to content

Commit cb52c0d

Browse files
authored
Merge pull request #1560 from oesteban/fix/issue-1348
FIX: Not having ``template`` as one ``--output-space`` crashes fMRIPrep
2 parents 48c46a4 + de00b65 commit cb52c0d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

fmriprep/workflows/bold/base.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,6 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
389389
('bold_aseg_t1', 'inputnode.bold_aseg_t1'),
390390
('bold_aparc_t1', 'inputnode.bold_aparc_t1'),
391391
('bold_mask_t1', 'inputnode.bold_mask_t1'),
392-
('bold_mni', 'inputnode.bold_mni'),
393-
('bold_mni_ref', 'inputnode.bold_mni_ref'),
394-
('bold_aseg_mni', 'inputnode.bold_aseg_mni'),
395-
('bold_aparc_mni', 'inputnode.bold_aparc_mni'),
396-
('bold_mask_mni', 'inputnode.bold_mask_mni'),
397392
('confounds', 'inputnode.confounds'),
398393
('surfaces', 'inputnode.surfaces'),
399394
('aroma_noise_ics', 'inputnode.aroma_noise_ics'),
@@ -405,6 +400,19 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
405400
]),
406401
])
407402

403+
if 'template' in output_spaces:
404+
# Artifacts resampled in MNI space can only be sinked if they
405+
# were actually generated. See #1348.
406+
workflow.connect([
407+
(outputnode, func_derivatives_wf, [
408+
('bold_mni_ref', 'inputnode.bold_mni_ref'),
409+
('bold_mni', 'inputnode.bold_mni'),
410+
('bold_aseg_mni', 'inputnode.bold_aseg_mni'),
411+
('bold_aparc_mni', 'inputnode.bold_aparc_mni'),
412+
('bold_mask_mni', 'inputnode.bold_mask_mni'),
413+
]),
414+
])
415+
408416
# Generate a tentative boldref
409417
bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads)
410418

0 commit comments

Comments
 (0)