Skip to content

Commit 66a9f2d

Browse files
committed
BF: Use index specified in file, rather than the loop index
1 parent 7af65ce commit 66a9f2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nibabel/freesurfer/io.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ def read_annot(filepath, orig_ids=False):
383383
name = np.fromfile(fobj, "|S%d" % name_length, 1)[0]
384384
names.append(name)
385385
# RGBA
386-
ctab[i, :4] = np.fromfile(fobj, dt, 4)
387-
ctab[i, 4] = (ctab[i, 0] +
388-
ctab[i, 1] * (2 ** 8) +
389-
ctab[i, 2] * (2 ** 16) +
390-
ctab[i, 3] * (2 ** 24))
386+
ctab[idx, :4] = np.fromfile(fobj, dt, 4)
387+
ctab[idx, 4] = (ctab[idx, 0] +
388+
ctab[idx, 1] * (2 ** 8) +
389+
ctab[idx, 2] * (2 ** 16) +
390+
ctab[idx, 3] * (2 ** 24))
391391

392392
# make sure names are strings, not bytes
393393
names = [n.decode('ascii') for n in names]

0 commit comments

Comments
 (0)