Skip to content

Commit 50f147c

Browse files
author
Ben Cipollini
committed
TST: Fix logic to check test values, use ones instead of zeros (zeros returned data read/copy fails).
1 parent 1c13e69 commit 50f147c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nibabel/tests/test_nifti1.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,11 +1248,14 @@ def test_rt_bias(self):
12481248
@runif_extra_has('slow')
12491249
def test_large_nifti1():
12501250
image_shape = (91, 109, 91, 1200)
1251-
img = Nifti1Image(np.zeros(image_shape, dtype=np.float32),
1251+
img = Nifti1Image(np.ones(image_shape, dtype=np.float32),
12521252
affine=np.eye(4))
1253+
# Dump and load the large image.
12531254
with InTemporaryDirectory():
12541255
img.to_filename('test.nii.gz')
12551256
del img
12561257
data = load('test.nii.gz').get_data()
1257-
assert_array_equal(np.asarray(image_shape), data.shape)
1258-
assert_true(np.all(data == 0.))
1258+
# Check that te data are all ones
1259+
assert_equal(image_shape, data.shape)
1260+
n_ones = np.sum((data == 1.))
1261+
assert_equal(np.prod(image_shape), n_ones)

0 commit comments

Comments
 (0)