@@ -770,7 +770,7 @@ def test_none_qsform(self):
770770 img_klass = self .image_class
771771 hdr_klass = img_klass .header_class
772772 shape = (2 , 3 , 4 )
773- data = np .arange (24 ).reshape (shape )
773+ data = np .arange (24 , dtype = 'f4' ).reshape (( 2 , 3 , 4 ) )
774774 # With specified affine
775775 aff = from_matvec (euler2mat (0.1 , 0.2 , 0.3 ), [11 , 12 , 13 ])
776776 for hdr in (None , hdr_klass ()):
@@ -1040,7 +1040,7 @@ def test_affines_init(self):
10401040 # is some thoughts by Mark Jenkinson:
10411041 # http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/qsform_brief_usage
10421042 IC = self .image_class
1043- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1043+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
10441044 aff = np .diag ([2 , 3 , 4 , 1 ])
10451045 # Default is sform set, qform not set
10461046 img = IC (arr , aff )
@@ -1073,7 +1073,7 @@ def test_affines_init(self):
10731073
10741074 def test_read_no_extensions (self ):
10751075 IC = self .image_class
1076- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1076+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
10771077 img = IC (arr , np .eye (4 ))
10781078 assert len (img .header .extensions ) == 0
10791079 img_rt = bytesio_round_trip (img )
@@ -1110,7 +1110,7 @@ class TestNifti1Image(TestNifti1Pair):
11101110 def test_offset_errors (self ):
11111111 # Test that explicit offset too low raises error
11121112 IC = self .image_class
1113- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1113+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
11141114 img = IC (arr , np .eye (4 ))
11151115 assert img .header .get_data_offset () == 0
11161116 # Saving with zero offset is OK
@@ -1365,7 +1365,7 @@ def test_loadsave_cycle(self):
13651365 def test_load (self ):
13661366 # test module level load. We try to load a nii and an .img and a .hdr
13671367 # and expect to get a nifti back of single or pair type
1368- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1368+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
13691369 aff = np .diag ([2 , 3 , 4 , 1 ])
13701370 simg = self .single_class (arr , aff )
13711371 pimg = self .pair_class (arr , aff )
@@ -1439,7 +1439,7 @@ def test_rt_bias(self):
14391439
14401440 def test_reoriented_dim_info (self ):
14411441 # Check that dim_info is reoriented correctly
1442- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1442+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
14431443 # Start as RAS
14441444 aff = np .diag ([2 , 3 , 4 , 1 ])
14451445 simg = self .single_class (arr , aff )
0 commit comments