@@ -458,7 +458,7 @@ def apply(
458
458
output_dtype = output_dtype or input_dtype
459
459
460
460
# Prepare physical coordinates of input (grid, points)
461
- xcoords = _ref .ndcoords .astype ("f4" )
461
+ xcoords = _ref .ndcoords .astype ("f4" ). T
462
462
463
463
# Invert target's (moving) affine once
464
464
ras2vox = ~ Affine (spatialimage .affine )
@@ -472,7 +472,7 @@ def apply(
472
472
# Order F ensures individual volumes are contiguous in memory
473
473
# Also matches NIfTI, making final save more efficient
474
474
resampled = np .zeros (
475
- (xcoords .T . shape [0 ], len (self )), dtype = output_dtype , order = "F"
475
+ (xcoords .shape [0 ], len (self )), dtype = output_dtype , order = "F"
476
476
)
477
477
478
478
dataobj = (
@@ -483,7 +483,7 @@ def apply(
483
483
484
484
for t , xfm_t in enumerate (self ):
485
485
# Map the input coordinates on to timepoint t of the target (moving)
486
- ycoords = xfm_t .map (xcoords . T )[..., : _ref .ndim ]
486
+ ycoords = xfm_t .map (xcoords )[..., : _ref .ndim ]
487
487
488
488
# Calculate corresponding voxel coordinates
489
489
yvoxels = ras2vox .map (ycoords )[..., : _ref .ndim ]
0 commit comments