File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -213,13 +213,15 @@ def _flatten_split_merge(in_files):
213
213
214
214
215
215
def _gen_reference (fixed_image , moving_image , out_file = None ):
216
- import os .path as op
217
216
import numpy
218
217
from nilearn .image import resample_img , load_img
219
218
220
219
if out_file is None :
221
220
out_file = genfname (fixed_image , suffix = 'reference' )
222
- new_zooms = load_img (moving_image ).header .get_zooms ()
223
- resample_img (fixed_image , target_affine = numpy .diag (new_zooms ),
221
+ new_zooms = load_img (moving_image ).header .get_zooms ()[:3 ]
222
+ # Avoid small differences in reported resolution to cause changes to
223
+ # FOV. See https://github.com/poldracklab/fmriprep/issues/512
224
+ new_zooms_round = numpy .round (new_zooms , 3 )
225
+ resample_img (fixed_image , target_affine = numpy .diag (new_zooms_round ),
224
226
interpolation = 'nearest' ).to_filename (out_file )
225
227
return out_file
You can’t perform that action at this time.
0 commit comments