@@ -92,7 +92,7 @@ def init_topup_wf(
92
92
93
93
from ...utils .misc import front as _front
94
94
from ...interfaces .epi import GetReadoutTime , SortPEBlips
95
- from ...interfaces .utils import UniformGrid , PadSlices
95
+ from ...interfaces .utils import UniformGrid , PadSlices , ReorientImageAndMetadata
96
96
from ...interfaces .bspline import TOPUPCoeffReorient
97
97
from ..ancillary import init_brainextraction_wf
98
98
@@ -145,7 +145,7 @@ def init_topup_wf(
145
145
setwise_avg = pe .Node (RobustAverage (num_threads = omp_nthreads ), name = "setwise_avg" )
146
146
# The core of the implementation
147
147
# Feed the input images in LAS orientation, so FSL does not run funky reorientations
148
- to_las = pe .Node (ReorientImage (target_orientation = "LAS" ), name = "to_las" )
148
+ to_las = pe .Node (ReorientImageAndMetadata (target_orientation = "LAS" ), name = "to_las" )
149
149
topup = pe .Node (
150
150
TOPUP (
151
151
config = _pkg_fname ("sdcflows" , f"data/flirtsch/b02b0{ '_quick' * sloppy } .cnf" )
@@ -172,16 +172,19 @@ def init_topup_wf(
172
172
(regrid , sort_pe_blips , [("out_data" , "in_data" )]),
173
173
(readout_time , sort_pe_blips , [("readout_time" , "readout_times" ),
174
174
("pe_dir_fsl" , "pe_dirs_fsl" )]),
175
- (sort_pe_blips , topup , [("readout_times" , "readout_times" ),
176
- ("pe_dirs_fsl" , "encoding_direction" )]),
177
- (sort_pe_blips , fix_coeff , [(("pe_dirs" , _front ), "pe_dir" )]),
175
+ (sort_pe_blips , topup , [("readout_times" , "readout_times" )]),
178
176
(setwise_avg , fix_coeff , [("out_file" , "fmap_ref" )]),
179
177
(sort_pe_blips , concat_blips , [("out_data" , "in_files" )]),
180
178
(concat_blips , pad_blip_slices , [("out_file" , "in_file" )]),
181
179
(pad_blip_slices , setwise_avg , [("out_file" , "in_file" )]),
182
180
(setwise_avg , to_las , [("out_hmc_volumes" , "in_file" )]),
183
- (to_las , topup , [("out_file" , "in_file" )]),
181
+ (sort_pe_blips , to_las , [("pe_dirs_fsl" , "pe_dir" )]),
182
+ (to_las , topup , [
183
+ ("out_file" , "in_file" ),
184
+ ("pe_dir" , "encoding_direction" ),
185
+ ]),
184
186
(topup , fix_coeff , [("out_fieldcoef" , "in_coeff" )]),
187
+ (to_las , fix_coeff , [(("pe_dir" , _front ), "pe_dir" )]),
185
188
(topup , outputnode , [("out_jacs" , "jacobians" ),
186
189
("out_mats" , "xfms" )]),
187
190
(ref_average , brainextraction_wf , [("out_file" , "inputnode.in_file" )]),
0 commit comments