13
13
14
14
import numpy as np
15
15
16
- from six import BytesIO
17
16
from .. import load , save
18
17
from ...openers import ImageOpener
19
18
from ..mghformat import MGHHeader , MGHError , MGHImage
@@ -171,7 +170,7 @@ def test_header_updating():
171
170
mgz = load (MGZ_FNAME )
172
171
hdr = mgz .header
173
172
# Test against mri_info output
174
- exp_aff = np .loadtxt (BytesIO (b"""
173
+ exp_aff = np .loadtxt (io . BytesIO (b"""
175
174
1.0000 2.0000 3.0000 -13.0000
176
175
2.0000 3.0000 1.0000 -11.5000
177
176
3.0000 1.0000 2.0000 -11.5000
@@ -182,7 +181,7 @@ def test_header_updating():
182
181
assert_equal (hdr ['delta' ], 1 )
183
182
assert_almost_equal (hdr ['Mdc' ], exp_aff [:3 , :3 ].T )
184
183
# Save, reload, same thing
185
- img_fobj = BytesIO ()
184
+ img_fobj = io . BytesIO ()
186
185
mgz2 = _mgh_rt (mgz , img_fobj )
187
186
hdr2 = mgz2 .header
188
187
assert_almost_equal (hdr2 .get_affine (), exp_aff , 6 )
@@ -206,7 +205,7 @@ def test_cosine_order():
206
205
aff [0 ] = [2 , 1 , 0 , 10 ]
207
206
img = MGHImage (data , aff )
208
207
assert_almost_equal (img .affine , aff , 6 )
209
- img_fobj = BytesIO ()
208
+ img_fobj = io . BytesIO ()
210
209
img2 = _mgh_rt (img , img_fobj )
211
210
hdr2 = img2 .header
212
211
RZS = aff [:3 , :3 ]
0 commit comments