File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
"""
12
12
from __future__ import print_function , division , unicode_literals , absolute_import
13
- from io import open
13
+ from builtins import open
14
14
15
15
import os .path as op
16
16
import nibabel as nb
@@ -55,11 +55,10 @@ def read_mrtrix_tracks(in_file, as_generator=True):
55
55
56
56
57
57
def read_mrtrix_header (in_file ):
58
- fileobj = open (in_file , 'rb ' )
58
+ fileobj = open (in_file , 'r ' )
59
59
header = {}
60
60
iflogger .info ('Reading header data...' )
61
61
for line in fileobj :
62
- line = line .decode ()
63
62
if line == 'END\n ' :
64
63
iflogger .info ('Reached the end of the header!' )
65
64
break
@@ -79,7 +78,7 @@ def read_mrtrix_header(in_file):
79
78
def read_mrtrix_streamlines (in_file , header , as_generator = True ):
80
79
offset = header ['offset' ]
81
80
stream_count = header ['count' ]
82
- fileobj = open (in_file , 'rb ' )
81
+ fileobj = open (in_file , 'r ' )
83
82
fileobj .seek (offset )
84
83
endianness = native_code
85
84
f4dt = np .dtype (endianness + 'f4' )
You can’t perform that action at this time.
0 commit comments