[Neuroimaging] Bug in reading freesurfer annotation in nibabel?
Gael Varoquaux
gael.varoquaux at normalesup.org
Tue Feb 21 07:57:28 EST 2017
Hi,
I am trying to load the freesurfer Destrieux atlas annotation file:
right.aparc.a2009s.annot
and I get the following error:
In [2]: import nibabel as nb
In [3]:
nb.freesurfer.read_annot('/home/varoquau/nilearn_data/destrieux_surface/left.aparc.a2009s.annot')
---------------------------------------------------------------------------
IndexError Traceback (most recent call
last)
<ipython-input-3-610fc2be58c1> in <module>()
----> 1
nb.freesurfer.read_annot('/home/varoquau/nilearn_data/destrieux_surface/left.aparc.a2009s.annot')
/home/varoquau/dev/nibabel/nibabel/freesurfer/io.pyc in
read_annot(filepath, orig_ids)
320 with open(filepath, "rb") as fobj:
321 dt = ">i4"
--> 322 vnum = np.fromfile(fobj, dt, 1)[0]
323 data = np.fromfile(fobj, dt, vnum * 2).reshape(vnum, 2)
324 labels = data[:, 1]
IndexError: index 0 is out of bounds for axis 0 with size 0
Same failure for the right annotation (with nibabel 2.1 or master).
Am I doing something wrong (eg file corrupted) or are people having the
same problem? This is a naive question: I know nothing about surfaces.
Cheers,
Gaël
--
Gael Varoquaux
Researcher, INRIA Parietal
NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France
Phone: ++ 33-1-69-08-79-68
http://gael-varoquaux.info http://twitter.com/GaelVaroquaux
More information about the Neuroimaging
mailing list