Open dangom opened 5 years ago
It seems there is a readline too much in parse_surf
. Removing the line fixes the issue for me. I'm on Python 3.7.3
Hi Daniel! Thanks for both posting this issue and finding a fix :) I was actually surprised upon seeing this that (1) we are still using our own code to parse freesurfer surfaces instead of nibabel (I think this module predates the introduction of nibabel as a dependency for pycortex), and (2) that we haven't run into this issue before.
Can you tell us what version of freesurfer you're using here? Also, is there something particular or strange about this surface?
Finally, can you confirm that the nibabel function freesurfer.read_geometry
can successfully load your surfaces? If so, I think it may be best for us to just switch to using nibabel to read freesurfer surfaces.
Uhm, interesting.
The surfaces were reconstructed with Freesurfer version freesurfer-local-build-dev-20190709
, and recon-all.log tells me that recon-all finished without error.
But I also cannot nib.freesurfer.read_geometry
for the smoothwm
surface, so I suppose there must be something wrong with it. The surfaces pial
and smoothwm
are "broken", but all others work. Freeview can read and display them without issues though.
I'll investigate further and report back when I find out what the issue is.
Oh, thanks for the pointer @dangom!
Recently came across pycortex and decided to give it a try. I'm having troubles getting it to import data from freesurfer, though, as pycortex raises a ValueError, as shown in the backtrace below. Any suggestions on how to proceed would be welcome.