Skip to content

Commit 2e65cf9

Browse files
author
Ben Cipollini
committed
TST: add image tests in large image test.
1 parent b061fe9 commit 2e65cf9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nibabel/tests/test_nifti1.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,11 +1244,13 @@ def test_rt_bias(self):
12441244
assert_true(np.abs(bias) < bias_thresh)
12451245

12461246

1247-
def test_large_nifti():
1248-
img = Nifti1Image(np.zeros((91, 109, 91, 1200), dtype=np.float32),
1247+
def test_large_nifti1():
1248+
image_shape = (91, 109, 91, 1200)
1249+
img = Nifti1Image(np.zeros(image_shape, dtype=np.float32),
12491250
affine=np.eye(4))
12501251
with InTemporaryDirectory():
12511252
img.to_filename('test.nii.gz')
12521253
del img
1253-
# Expect to fail on Python 3.5
1254-
load('test.nii.gz').get_data()
1254+
data = load('test.nii.gz').get_data()
1255+
assert_equal(np.asarray(image_shape), data.shape)
1256+
assert_true(np.all(data == 0.))

0 commit comments

Comments
 (0)