Skip to content

Commit c6087f5

Browse files
author
Erik Ziegler
committed
Fix for MRtrix-TrackVis conversion of tracks have been normalized or filtered
1 parent ce62e1d commit c6087f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/interfaces/mrtrix/convert.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ def track_gen(track_points):
100100
n_streams = 0
101101
iflogger.info('Reading tracks...')
102102
while True:
103-
n_pts = track_points[n_streams]
103+
try:
104+
n_pts = track_points[n_streams]
105+
except IndexError:
106+
break
104107
pts_str = fileobj.read(n_pts * bytesize)
105108
nan_str = fileobj.read(bytesize)
106109
if len(pts_str) < (n_pts * bytesize):

0 commit comments

Comments
 (0)