@@ -770,7 +770,7 @@ def test_none_qsform(self):
770
770
img_klass = self .image_class
771
771
hdr_klass = img_klass .header_class
772
772
shape = (2 , 3 , 4 )
773
- data = np .arange (24 ).reshape (shape )
773
+ data = np .arange (24 , dtype = 'f4' ).reshape (( 2 , 3 , 4 ) )
774
774
# With specified affine
775
775
aff = from_matvec (euler2mat (0.1 , 0.2 , 0.3 ), [11 , 12 , 13 ])
776
776
for hdr in (None , hdr_klass ()):
@@ -1040,7 +1040,7 @@ def test_affines_init(self):
1040
1040
# is some thoughts by Mark Jenkinson:
1041
1041
# http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/qsform_brief_usage
1042
1042
IC = self .image_class
1043
- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1043
+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
1044
1044
aff = np .diag ([2 , 3 , 4 , 1 ])
1045
1045
# Default is sform set, qform not set
1046
1046
img = IC (arr , aff )
@@ -1073,7 +1073,7 @@ def test_affines_init(self):
1073
1073
1074
1074
def test_read_no_extensions (self ):
1075
1075
IC = self .image_class
1076
- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1076
+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
1077
1077
img = IC (arr , np .eye (4 ))
1078
1078
assert len (img .header .extensions ) == 0
1079
1079
img_rt = bytesio_round_trip (img )
@@ -1110,7 +1110,7 @@ class TestNifti1Image(TestNifti1Pair):
1110
1110
def test_offset_errors (self ):
1111
1111
# Test that explicit offset too low raises error
1112
1112
IC = self .image_class
1113
- arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
1113
+ arr = np .arange (24 , dtype = 'f4' ).reshape ((2 , 3 , 4 ))
1114
1114
img = IC (arr , np .eye (4 ))
1115
1115
assert img .header .get_data_offset () == 0
1116
1116
# Saving with zero offset is OK
@@ -1365,7 +1365,7 @@ def test_loadsave_cycle(self):
1365
1365
def test_load (self ):
1366
1366
# test module level load. We try to load a nii and an .img and a .hdr
1367
1367
# 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 ))
1369
1369
aff = np .diag ([2 , 3 , 4 , 1 ])
1370
1370
simg = self .single_class (arr , aff )
1371
1371
pimg = self .pair_class (arr , aff )
@@ -1439,7 +1439,7 @@ def test_rt_bias(self):
1439
1439
1440
1440
def test_reoriented_dim_info (self ):
1441
1441
# 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 ))
1443
1443
# Start as RAS
1444
1444
aff = np .diag ([2 , 3 , 4 , 1 ])
1445
1445
simg = self .single_class (arr , aff )
0 commit comments