@@ -389,11 +389,6 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
389
389
('bold_aseg_t1' , 'inputnode.bold_aseg_t1' ),
390
390
('bold_aparc_t1' , 'inputnode.bold_aparc_t1' ),
391
391
('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' ),
397
392
('confounds' , 'inputnode.confounds' ),
398
393
('surfaces' , 'inputnode.surfaces' ),
399
394
('aroma_noise_ics' , 'inputnode.aroma_noise_ics' ),
@@ -405,6 +400,19 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
405
400
]),
406
401
])
407
402
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
+
408
416
# Generate a tentative boldref
409
417
bold_reference_wf = init_bold_reference_wf (omp_nthreads = omp_nthreads )
410
418
0 commit comments