@@ -123,7 +123,7 @@ def test_write_mgh():
123123def test_write_noaffine_mgh ():
124124 # now just save the image without the vox2ras transform
125125 # and see if it uses the default values to save
126- v = np .ones ((7 , 13 , 3 , 22 )). astype ( np .uint8 )
126+ v = np .ones ((7 , 13 , 3 , 22 ), np .uint8 )
127127 # form a MGHImage object using data
128128 # and the default affine matrix (Note the "None")
129129 img = MGHImage (v , None )
@@ -175,7 +175,7 @@ def bad_dtype_mgh():
175175 """
176176 # try to write an unsigned short and make sure it
177177 # raises MGHError
178- v = np .ones ((7 , 13 , 3 , 22 )). astype ( np .uint16 )
178+ v = np .ones ((7 , 13 , 3 , 22 ), np .uint16 )
179179 # form a MGHImage object using data
180180 # and the default affine matrix (Note the "None")
181181 MGHImage (v , None )
@@ -189,7 +189,7 @@ def test_bad_dtype_mgh():
189189
190190def test_filename_exts ():
191191 # Test acceptable filename extensions
192- v = np .ones ((7 , 13 , 3 , 22 )). astype ( np .uint8 )
192+ v = np .ones ((7 , 13 , 3 , 22 ), np .uint8 )
193193 # form a MGHImage object using data
194194 # and the default affine matrix (Note the "None")
195195 img = MGHImage (v , None )
@@ -251,7 +251,7 @@ def test_header_updating():
251251
252252def test_cosine_order ():
253253 # Test we are interpreting the cosine order right
254- data = np .arange (60 ).reshape ((3 , 4 , 5 )). astype ( np . int32 )
254+ data = np .arange (60 , dtype = np . int32 ).reshape ((3 , 4 , 5 ))
255255 aff = np .diag ([2.0 , 3 , 4 , 1 ])
256256 aff [0 ] = [2 , 1 , 0 , 10 ]
257257 img = MGHImage (data , aff )
0 commit comments