3434from .hmc import init_bold_hmc_wf
3535from .stc import init_bold_stc_wf
3636from .t2s import init_bold_t2s_wf
37- from .registration import init_bold_reg_wf
37+ from .registration import init_bold_t1_trans_wf , init_bold_reg_wf
3838from .resampling import (
3939 init_bold_surf_wf ,
4040 init_bold_mni_trans_wf ,
@@ -211,6 +211,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
211211 * :py:func:`~fmriprep.workflows.bold.stc.init_bold_stc_wf`
212212 * :py:func:`~fmriprep.workflows.bold.hmc.init_bold_hmc_wf`
213213 * :py:func:`~fmriprep.workflows.bold.t2s.init_bold_t2s_wf`
214+ * :py:func:`~fmriprep.workflows.bold.registration.init_bold_t1_trans_wf`
214215 * :py:func:`~fmriprep.workflows.bold.registration.init_bold_reg_wf`
215216 * :py:func:`~fmriprep.workflows.bold.confounds.init_bold_confounds_wf`
216217 * :py:func:`~fmriprep.workflows.bold.confounds.init_ica_aroma_wf`
@@ -404,15 +405,22 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
404405 mem_gb = mem_gb ['filesize' ],
405406 omp_nthreads = omp_nthreads )
406407
407- # mean BOLD registration to T1w
408+ # calculate BOLD registration to T1w
408409 bold_reg_wf = init_bold_reg_wf (name = 'bold_reg_wf' ,
409410 freesurfer = freesurfer ,
410411 use_bbr = use_bbr ,
411412 bold2t1w_dof = bold2t1w_dof ,
412413 mem_gb = mem_gb ['resampled' ],
413414 omp_nthreads = omp_nthreads ,
414- use_compression = False ,
415- use_fieldwarp = (fmaps is not None or use_syn ))
415+ use_compression = False )
416+
417+ # apply BOLD registration to T1w
418+ bold_t1_trans_wf = init_bold_t1_trans_wf (name = 'bold_t1_trans_wf' ,
419+ freesurfer = freesurfer ,
420+ use_fieldwarp = (fmaps is not None or use_syn ),
421+ mem_gb = mem_gb ['resampled' ],
422+ omp_nthreads = omp_nthreads ,
423+ use_compression = False )
416424
417425 # get confounds
418426 bold_confounds_wf = init_bold_confs_wf (
@@ -476,22 +484,25 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
476484 ('outputnode.bold_file' , 'inputnode.bold_file' )]),
477485 # EPI-T1 registration workflow
478486 (inputnode , bold_reg_wf , [
479- ('bold_file' , 'inputnode.name_source' ),
480- ('t1_preproc' , 'inputnode.t1_preproc' ),
481487 ('t1_brain' , 'inputnode.t1_brain' ),
482- ('t1_mask' , 'inputnode.t1_mask' ),
483488 ('t1_seg' , 'inputnode.t1_seg' ),
484- ('t1_aseg' , 'inputnode.t1_aseg' ),
485- ('t1_aparc' , 'inputnode.t1_aparc' ),
486489 # Undefined if --no-freesurfer, but this is safe
487490 ('subjects_dir' , 'inputnode.subjects_dir' ),
488491 ('subject_id' , 'inputnode.subject_id' ),
489492 ('t1_2_fsnative_reverse_transform' , 'inputnode.t1_2_fsnative_reverse_transform' )]),
490- (bold_split , bold_reg_wf , [('out_files' , 'inputnode.bold_split' )]),
491- (bold_hmc_wf , bold_reg_wf , [('outputnode.xforms' , 'inputnode.hmc_xforms' )]),
492- (bold_reg_wf , outputnode , [('outputnode.bold_t1' , 'bold_t1' ),
493- ('outputnode.bold_aseg_t1' , 'bold_aseg_t1' ),
494- ('outputnode.bold_aparc_t1' , 'bold_aparc_t1' )]),
493+ (inputnode , bold_t1_trans_wf , [
494+ ('bold_file' , 'inputnode.name_source' ),
495+ ('t1_brain' , 'inputnode.t1_brain' ),
496+ ('t1_mask' , 'inputnode.t1_mask' ),
497+ ('t1_aseg' , 'inputnode.t1_aseg' ),
498+ ('t1_aparc' , 'inputnode.t1_aparc' )]),
499+ (bold_split , bold_t1_trans_wf , [('out_files' , 'inputnode.bold_split' )]),
500+ (bold_hmc_wf , bold_t1_trans_wf , [('outputnode.xforms' , 'inputnode.hmc_xforms' )]),
501+ (bold_reg_wf , bold_t1_trans_wf , [
502+ ('outputnode.itk_bold_to_t1' , 'inputnode.itk_bold_to_t1' )]),
503+ (bold_t1_trans_wf , outputnode , [('outputnode.bold_t1' , 'bold_t1' ),
504+ ('outputnode.bold_aseg_t1' , 'bold_aseg_t1' ),
505+ ('outputnode.bold_aparc_t1' , 'bold_aparc_t1' )]),
495506 (bold_reg_wf , summary , [('outputnode.fallback' , 'fallback' )]),
496507 # SDC (or pass-through workflow)
497508 (inputnode , bold_sdc_wf , [
@@ -502,6 +513,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
502513 ('outputnode.ref_image_brain' , 'inputnode.bold_ref_brain' ),
503514 ('outputnode.bold_mask' , 'inputnode.bold_mask' )]),
504515 (bold_sdc_wf , bold_reg_wf , [
516+ ('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' )]),
517+ (bold_sdc_wf , bold_t1_trans_wf , [
505518 ('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' ),
506519 ('outputnode.bold_mask' , 'inputnode.ref_bold_mask' ),
507520 ('outputnode.out_warp' , 'inputnode.fieldwarp' )]),
@@ -598,14 +611,14 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
598611
599612 # Replace EPI-to-T1w registration inputs
600613 workflow .disconnect ([
601- (bold_sdc_wf , bold_reg_wf , [
614+ (bold_sdc_wf , bold_t1_trans_wf , [
602615 ('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' ),
603616 ('outputnode.bold_mask' , 'inputnode.ref_bold_mask' )]),
604617 ])
605618 workflow .connect ([
606619 (bold_hmc_wf , bold_t2s_wf , [
607620 ('outputnode.xforms' , 'inputnode.hmc_xforms' )]),
608- (bold_t2s_wf , bold_reg_wf , [
621+ (bold_t2s_wf , bold_t1_trans_wf , [
609622 ('outputnode.t2s_map' , 'inputnode.ref_bold_brain' ),
610623 ('outputnode.oc_mask' , 'inputnode.ref_bold_mask' )]),
611624 ])
@@ -624,8 +637,9 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
624637 (bold_bold_trans_wf , boldmask_to_t1w , [
625638 ('outputnode.bold_mask' , 'input_image' )]),
626639 (bold_reg_wf , boldmask_to_t1w , [
627- ('outputnode.bold_mask_t1' , 'reference_image' ),
628640 ('outputnode.itk_bold_to_t1' , 'transforms' )]),
641+ (bold_t1_trans_wf , boldmask_to_t1w , [
642+ ('outputnode.bold_mask_t1' , 'reference_image' )]),
629643 (boldmask_to_t1w , outputnode , [
630644 ('output_image' , 'bold_mask_t1' )]),
631645 ])
@@ -736,7 +750,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
736750 ('subjects_dir' , 'inputnode.subjects_dir' ),
737751 ('subject_id' , 'inputnode.subject_id' ),
738752 ('t1_2_fsnative_forward_transform' , 'inputnode.t1_2_fsnative_forward_transform' )]),
739- (bold_reg_wf , bold_surf_wf , [('outputnode.bold_t1' , 'inputnode.source_file' )]),
753+ (bold_t1_trans_wf , bold_surf_wf , [('outputnode.bold_t1' , 'inputnode.source_file' )]),
740754 (bold_surf_wf , outputnode , [('outputnode.surfaces' , 'surfaces' )]),
741755 ])
742756
0 commit comments