Skip to content

Commit 1a28a51

Browse files
committed
TEST: Test voxel size padding
1 parent e06d63e commit 1a28a51

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nibabel/tests/test_processing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,11 @@ def test_resample_to_output():
214214
img2 = resample_to_output(img, vox_sizes)
215215
# Check 2D works
216216
img_2d = Nifti1Image(data[0], np.eye(4))
217-
img3 = resample_to_output(img_2d)
218-
assert_array_equal(img3.shape, (3, 4, 1))
219-
assert_array_equal(img3.affine, np.eye(4))
220-
assert_array_equal(img3.dataobj, data[0][..., None])
217+
for vox_sizes in (None, 1, (1, 1), (1, 1, 1)):
218+
img3 = resample_to_output(img_2d, vox_sizes)
219+
assert_array_equal(img3.shape, (3, 4, 1))
220+
assert_array_equal(img3.affine, np.eye(4))
221+
assert_array_equal(img3.dataobj, data[0][..., None])
221222
# Even 1D
222223
img_1d = Nifti1Image(data[0, 0], np.eye(4))
223224
img3 = resample_to_output(img_1d)

0 commit comments

Comments
 (0)