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):
1248
1248
@runif_extra_has ('slow' )
1249
1249
def test_large_nifti1 ():
1250
1250
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 ),
1252
1252
affine = np .eye (4 ))
1253
+ # Dump and load the large image.
1253
1254
with InTemporaryDirectory ():
1254
1255
img .to_filename ('test.nii.gz' )
1255
1256
del img
1256
1257
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