Skip to content

Commit ebae5c7

Browse files
authored
tst: improve test with more specific inputs
The shape of the output is defined by the reference shape in space, and by the input and the transform in the 4th dimension.
1 parent bfa39e1 commit ebae5c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nitransforms/tests/test_resampling.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ def test_apply_singleton_time_dimension():
5656

5757
data = np.reshape(np.arange(27, dtype=np.uint8), (3, 3, 3, 1))
5858
nii = nb.Nifti1Image(data, np.eye(4))
59-
xfm = nitl.Affine(np.eye(4), reference=nii)
59+
ref = nb.Nifti1Image(np.zeros((4, 4, 4)), np.eye(4))
60+
xfm = nitl.Affine(np.eye(4), reference=ref)
6061
movednii = apply(xfm, nii)
61-
assert movednii.shape == nii.shape
62+
assert movednii.shape == ref.shape + (1, )
63+
64+
movednii = apply(xfm, nii, reference=ref)
65+
assert movednii.shape == ref.shape + (1, )
6266

6367

6468
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)