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 1010
1111"""
1212from __future__ import print_function , division , unicode_literals , absolute_import
13- from io import open
13+ from builtins import open
1414
1515import os .path as op
1616import nibabel as nb
@@ -55,11 +55,10 @@ def read_mrtrix_tracks(in_file, as_generator=True):
5555
5656
5757def read_mrtrix_header (in_file ):
58- fileobj = open (in_file , 'rb ' )
58+ fileobj = open (in_file , 'r ' )
5959 header = {}
6060 iflogger .info ('Reading header data...' )
6161 for line in fileobj :
62- line = line .decode ()
6362 if line == 'END\n ' :
6463 iflogger .info ('Reached the end of the header!' )
6564 break
@@ -79,7 +78,7 @@ def read_mrtrix_header(in_file):
7978def read_mrtrix_streamlines (in_file , header , as_generator = True ):
8079 offset = header ['offset' ]
8180 stream_count = header ['count' ]
82- fileobj = open (in_file , 'rb ' )
81+ fileobj = open (in_file , 'r ' )
8382 fileobj .seek (offset )
8483 endianness = native_code
8584 f4dt = np .dtype (endianness + 'f4' )
You can’t perform that action at this time.
0 commit comments