@@ -123,7 +123,7 @@ def test_write_mgh():
123
123
def test_write_noaffine_mgh ():
124
124
# now just save the image without the vox2ras transform
125
125
# 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 )
127
127
# form a MGHImage object using data
128
128
# and the default affine matrix (Note the "None")
129
129
img = MGHImage (v , None )
@@ -175,7 +175,7 @@ def bad_dtype_mgh():
175
175
"""
176
176
# try to write an unsigned short and make sure it
177
177
# raises MGHError
178
- v = np .ones ((7 , 13 , 3 , 22 )). astype ( np .uint16 )
178
+ v = np .ones ((7 , 13 , 3 , 22 ), np .uint16 )
179
179
# form a MGHImage object using data
180
180
# and the default affine matrix (Note the "None")
181
181
MGHImage (v , None )
@@ -189,7 +189,7 @@ def test_bad_dtype_mgh():
189
189
190
190
def test_filename_exts ():
191
191
# 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 )
193
193
# form a MGHImage object using data
194
194
# and the default affine matrix (Note the "None")
195
195
img = MGHImage (v , None )
@@ -251,7 +251,7 @@ def test_header_updating():
251
251
252
252
def test_cosine_order ():
253
253
# 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 ))
255
255
aff = np .diag ([2.0 , 3 , 4 , 1 ])
256
256
aff [0 ] = [2 , 1 , 0 , 10 ]
257
257
img = MGHImage (data , aff )
0 commit comments