Skip to content

Commit 01cb7cd

Browse files
committed
fix: squeeze last dimension of moving image in apply()
Resolves: #270.
1 parent be5ddd6 commit 01cb7cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nitransforms/resampling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from nibabel.loadsave import load as _nbload
2020
from nibabel.arrayproxy import get_obj_dtype
2121
from nibabel.spatialimages import SpatialImage
22+
from nibabel.funcs import squeeze_image
2223
from scipy import ndimage as ndi
2324

2425
from nitransforms.base import (
@@ -233,6 +234,8 @@ def apply(
233234
if isinstance(spatialimage, (str, Path)):
234235
spatialimage = _nbload(str(spatialimage))
235236

237+
spatialimage = squeeze_image(spatialimage)
238+
236239
# Avoid opening the data array just yet
237240
input_dtype = cap_dtype(get_obj_dtype(spatialimage.dataobj), dtype_width)
238241

0 commit comments

Comments
 (0)