File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1248,11 +1248,14 @@ def test_rt_bias(self):
12481248@runif_extra_has ('slow' )
12491249def 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 )
You can’t perform that action at this time.
0 commit comments