@@ -97,7 +97,7 @@ def test_adapt_affine():
9797@needs_scipy
9898def test_resample_from_to (caplog ):
9999 # Test resampling from image to image / image space
100- data = np .arange (24 ).reshape ((2 , 3 , 4 ))
100+ data = np .arange (24 , dtype = 'int32' ).reshape ((2 , 3 , 4 ))
101101 affine = np .diag ([- 4 , 5 , 6 , 1 ])
102102 img = Nifti1Image (data , affine )
103103 img .header ['descrip' ] = 'red shirt image'
@@ -186,7 +186,7 @@ def test_resample_from_to(caplog):
186186 out = resample_from_to (img , (img_2d .shape , img_2d .affine ))
187187 assert_array_equal (out .dataobj , data [:, :, 0 ])
188188 # 4D input and output also OK
189- data_4d = np .arange (24 * 5 ).reshape ((2 , 3 , 4 , 5 ))
189+ data_4d = np .arange (24 * 5 , dtype = 'int32' ).reshape ((2 , 3 , 4 , 5 ))
190190 img_4d = Nifti1Image (data_4d , affine )
191191 out = resample_from_to (img_4d , img_4d )
192192 assert_almost_equal (data_4d , out .dataobj )
@@ -202,7 +202,7 @@ def test_resample_from_to(caplog):
202202def test_resample_to_output (caplog ):
203203 # Test routine to sample iamges to output space
204204 # Image aligned to output axes - no-op
205- data = np .arange (24 ).reshape ((2 , 3 , 4 ))
205+ data = np .arange (24 , dtype = 'int32' ).reshape ((2 , 3 , 4 ))
206206 img = Nifti1Image (data , np .eye (4 ))
207207 # Check default resampling
208208 img2 = resample_to_output (img )
@@ -305,7 +305,7 @@ def test_resample_to_output(caplog):
305305@needs_scipy
306306def test_smooth_image (caplog ):
307307 # Test image smoothing
308- data = np .arange (24 ).reshape ((2 , 3 , 4 ))
308+ data = np .arange (24 , dtype = 'int32' ).reshape ((2 , 3 , 4 ))
309309 aff = np .diag ([- 4 , 5 , 6 , 1 ])
310310 img = Nifti1Image (data , aff )
311311 # Zero smoothing is no-op
@@ -332,7 +332,7 @@ def test_smooth_image(caplog):
332332 with pytest .raises (ValueError ):
333333 smooth_image (img_2d , [8 , 8 , 8 ])
334334 # Isotropic in 4D has zero for last dimension in scalar case
335- data_4d = np .arange (24 * 5 ).reshape ((2 , 3 , 4 , 5 ))
335+ data_4d = np .arange (24 * 5 , dtype = 'int32' ).reshape ((2 , 3 , 4 , 5 ))
336336 img_4d = Nifti1Image (data_4d , aff )
337337 exp_out = spnd .gaussian_filter (data_4d , list (sd ) + [0 ], mode = 'nearest' )
338338 assert_array_equal (smooth_image (img_4d , 8 ).dataobj , exp_out )
0 commit comments