34
34
from .hmc import init_bold_hmc_wf
35
35
from .stc import init_bold_stc_wf
36
36
from .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
38
38
from .resampling import (
39
39
init_bold_surf_wf ,
40
40
init_bold_mni_trans_wf ,
@@ -211,6 +211,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
211
211
* :py:func:`~fmriprep.workflows.bold.stc.init_bold_stc_wf`
212
212
* :py:func:`~fmriprep.workflows.bold.hmc.init_bold_hmc_wf`
213
213
* :py:func:`~fmriprep.workflows.bold.t2s.init_bold_t2s_wf`
214
+ * :py:func:`~fmriprep.workflows.bold.registration.init_bold_t1_trans_wf`
214
215
* :py:func:`~fmriprep.workflows.bold.registration.init_bold_reg_wf`
215
216
* :py:func:`~fmriprep.workflows.bold.confounds.init_bold_confounds_wf`
216
217
* :py:func:`~fmriprep.workflows.bold.confounds.init_ica_aroma_wf`
@@ -404,15 +405,22 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
404
405
mem_gb = mem_gb ['filesize' ],
405
406
omp_nthreads = omp_nthreads )
406
407
407
- # mean BOLD registration to T1w
408
+ # calculate BOLD registration to T1w
408
409
bold_reg_wf = init_bold_reg_wf (name = 'bold_reg_wf' ,
409
410
freesurfer = freesurfer ,
410
411
use_bbr = use_bbr ,
411
412
bold2t1w_dof = bold2t1w_dof ,
412
413
mem_gb = mem_gb ['resampled' ],
413
414
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 )
416
424
417
425
# get confounds
418
426
bold_confounds_wf = init_bold_confs_wf (
@@ -476,22 +484,25 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
476
484
('outputnode.bold_file' , 'inputnode.bold_file' )]),
477
485
# EPI-T1 registration workflow
478
486
(inputnode , bold_reg_wf , [
479
- ('bold_file' , 'inputnode.name_source' ),
480
- ('t1_preproc' , 'inputnode.t1_preproc' ),
481
487
('t1_brain' , 'inputnode.t1_brain' ),
482
- ('t1_mask' , 'inputnode.t1_mask' ),
483
488
('t1_seg' , 'inputnode.t1_seg' ),
484
- ('t1_aseg' , 'inputnode.t1_aseg' ),
485
- ('t1_aparc' , 'inputnode.t1_aparc' ),
486
489
# Undefined if --no-freesurfer, but this is safe
487
490
('subjects_dir' , 'inputnode.subjects_dir' ),
488
491
('subject_id' , 'inputnode.subject_id' ),
489
492
('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' )]),
495
506
(bold_reg_wf , summary , [('outputnode.fallback' , 'fallback' )]),
496
507
# SDC (or pass-through workflow)
497
508
(inputnode , bold_sdc_wf , [
@@ -502,6 +513,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
502
513
('outputnode.ref_image_brain' , 'inputnode.bold_ref_brain' ),
503
514
('outputnode.bold_mask' , 'inputnode.bold_mask' )]),
504
515
(bold_sdc_wf , bold_reg_wf , [
516
+ ('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' )]),
517
+ (bold_sdc_wf , bold_t1_trans_wf , [
505
518
('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' ),
506
519
('outputnode.bold_mask' , 'inputnode.ref_bold_mask' ),
507
520
('outputnode.out_warp' , 'inputnode.fieldwarp' )]),
@@ -598,14 +611,14 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
598
611
599
612
# Replace EPI-to-T1w registration inputs
600
613
workflow .disconnect ([
601
- (bold_sdc_wf , bold_reg_wf , [
614
+ (bold_sdc_wf , bold_t1_trans_wf , [
602
615
('outputnode.bold_ref_brain' , 'inputnode.ref_bold_brain' ),
603
616
('outputnode.bold_mask' , 'inputnode.ref_bold_mask' )]),
604
617
])
605
618
workflow .connect ([
606
619
(bold_hmc_wf , bold_t2s_wf , [
607
620
('outputnode.xforms' , 'inputnode.hmc_xforms' )]),
608
- (bold_t2s_wf , bold_reg_wf , [
621
+ (bold_t2s_wf , bold_t1_trans_wf , [
609
622
('outputnode.t2s_map' , 'inputnode.ref_bold_brain' ),
610
623
('outputnode.oc_mask' , 'inputnode.ref_bold_mask' )]),
611
624
])
@@ -624,8 +637,9 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
624
637
(bold_bold_trans_wf , boldmask_to_t1w , [
625
638
('outputnode.bold_mask' , 'input_image' )]),
626
639
(bold_reg_wf , boldmask_to_t1w , [
627
- ('outputnode.bold_mask_t1' , 'reference_image' ),
628
640
('outputnode.itk_bold_to_t1' , 'transforms' )]),
641
+ (bold_t1_trans_wf , boldmask_to_t1w , [
642
+ ('outputnode.bold_mask_t1' , 'reference_image' )]),
629
643
(boldmask_to_t1w , outputnode , [
630
644
('output_image' , 'bold_mask_t1' )]),
631
645
])
@@ -736,7 +750,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
736
750
('subjects_dir' , 'inputnode.subjects_dir' ),
737
751
('subject_id' , 'inputnode.subject_id' ),
738
752
('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' )]),
740
754
(bold_surf_wf , outputnode , [('outputnode.surfaces' , 'surfaces' )]),
741
755
])
742
756
0 commit comments