@@ -484,10 +484,13 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
484
484
# Gradient unwarping
485
485
if config .workflow .gradunwarp_file :
486
486
gradunwarp_wf = init_gradunwarp_wf ()
487
- gradunwarp_wf .inputs .inputnode .grad_file = gradunwarp_file
488
- workflow .connect (
489
- [(initial_boldref_wf , gradunwarp_wf , [('raw_ref_image' , 'in_file' )])]
490
- )
487
+ gradunwarp_wf .inputs .inputnode .grad_file = config .workflow .gradunwarp_file
488
+ # input corrected file, raw not necessary, only uses acquisition matrix size
489
+ # unless mask/ref are used for sdcflows
490
+ workflow .connect ([
491
+ (initial_boldref_wf , gradunwarp_wf , [
492
+ ('outputnode.raw_ref_image' , 'inputnode.input_file' )]),
493
+ ])
491
494
492
495
# HMC on the BOLD
493
496
bold_hmc_wf = init_bold_hmc_wf (
@@ -649,6 +652,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
649
652
("mask" , "inputnode.ref_bold_mask" ),
650
653
("boldref" , "inputnode.ref_bold_brain" ),
651
654
]),
655
+ (gradunwarp_wf , bold_t1_trans_wf , [('outputnode.warp_file' , 'inputnode.gradient_warp' )]),
652
656
(bold_t1_trans_wf , outputnode , [
653
657
("outputnode.bold_t1" , "bold_t1" ),
654
658
("outputnode.bold_t1_ref" , "bold_t1_ref" ),
@@ -814,6 +818,9 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
814
818
("outputnode.bold_std_ref" , "bold_std_ref" ),
815
819
("outputnode.bold_mask_std" , "bold_mask_std" ),
816
820
]),
821
+ (gradunwarp_wf , bold_std_trans_wf , [
822
+ ('outputnode.warp_file' , 'inputnode.gradient_warp' )
823
+ ]),
817
824
])
818
825
# fmt:on
819
826
@@ -1033,6 +1040,7 @@ def _last(inlist):
1033
1040
(bold_hmc_wf , bold_bold_trans_wf , [
1034
1041
("outputnode.xforms" , "inputnode.hmc_xforms" ),
1035
1042
]),
1043
+ (gradunwarp_wf , bold_bold_trans_wf , [('outputnode.warp_file' , 'inputnode.gradient_warp' )]),
1036
1044
])
1037
1045
1038
1046
workflow .connect ([
0 commit comments