1313
1414import numpy as np
1515
16- from six import BytesIO
1716from .. import load , save
1817from ...openers import ImageOpener
1918from ..mghformat import MGHHeader , MGHError , MGHImage
@@ -171,7 +170,7 @@ def test_header_updating():
171170 mgz = load (MGZ_FNAME )
172171 hdr = mgz .header
173172 # Test against mri_info output
174- exp_aff = np .loadtxt (BytesIO (b"""
173+ exp_aff = np .loadtxt (io . BytesIO (b"""
175174 1.0000 2.0000 3.0000 -13.0000
176175 2.0000 3.0000 1.0000 -11.5000
177176 3.0000 1.0000 2.0000 -11.5000
@@ -182,7 +181,7 @@ def test_header_updating():
182181 assert_equal (hdr ['delta' ], 1 )
183182 assert_almost_equal (hdr ['Mdc' ], exp_aff [:3 , :3 ].T )
184183 # Save, reload, same thing
185- img_fobj = BytesIO ()
184+ img_fobj = io . BytesIO ()
186185 mgz2 = _mgh_rt (mgz , img_fobj )
187186 hdr2 = mgz2 .header
188187 assert_almost_equal (hdr2 .get_affine (), exp_aff , 6 )
@@ -206,7 +205,7 @@ def test_cosine_order():
206205 aff [0 ] = [2 , 1 , 0 , 10 ]
207206 img = MGHImage (data , aff )
208207 assert_almost_equal (img .affine , aff , 6 )
209- img_fobj = BytesIO ()
208+ img_fobj = io . BytesIO ()
210209 img2 = _mgh_rt (img , img_fobj )
211210 hdr2 = img2 .header
212211 RZS = aff [:3 , :3 ]
0 commit comments