Skip to content

Commit be5ddd6

Browse files
committed
test: reproduce 4d singleton issue
1 parent 7772372 commit be5ddd6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nitransforms/tests/test_resampling.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@
5151
}
5252

5353

54+
def test_apply_singleton_time_dimension():
55+
"""Resampling fails when the input image has a trailing singleton dimension (gh-270)."""
56+
57+
data = np.reshape(np.arange(27, dtype=np.uint8), (3, 3, 3, 1))
58+
nii = nb.Nifti1Image(data, np.eye(4))
59+
xfm = nitl.Affine(np.eye(4), reference=nii)
60+
apply(xfm, nii)
61+
62+
5463
@pytest.mark.parametrize(
5564
"image_orientation",
5665
[

0 commit comments

Comments
 (0)