@@ -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