[FieldTrip] [full-message] Failure to import cortical surface extracted with Freesurfer into Matlab using ft_read_headshape

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed May 1 16:13:49 CEST 2019


Hi Darinka,

I cannot confirm your problem, although admittedly I have used different software versions (matlab/fieldtrip/freesurfer) etc.
The problem seems to occur in read_surf, which is not maintained by us, but comes from the freesurfer folks. Can you confirm that the version of read_surf that the call to ft_read_headshape ends up using is in external/freesurfer?


best wishes,
Jan-Mathijs


On 1 May 2019, at 14:56, Darinka Trübutschek <darinkat87 at gmail.com<mailto:darinkat87 at gmail.com>> wrote:

Dear fieldtrip community,

Sorry for double-posting - my original message somehow seems to have been cut short...


I am currently trying to import cortical surfaces extracted with freesurfer (version: freesurfer-linux-centos7_x86_64-dev-20190403-dacefd1) into Matlab (version: R2018b) using the fieldtrip function ft_read_headshape (version: 20190329). All of this is run in an Ubuntu 18.04.2 LTS environment. While all of the extracted surfaces seem fine upon visual inspection in freeview, the import into Matlab fails, throwing the following error message:

pial = ft_read_headshape('freesurfer/surf/lh.pial');
Error using fread
Invalid size.

Error in read_surf (line 72)
  vertex_coords = fread(fid, vnum*3, 'float32') ;

Error in ft_read_headshape (line 909)
    [pos, tri] = read_surf(filename);

It is most certainly related to the fact that, both for the number of vertices (vnum) and the number of faces (fnum), the function read_surf returns non-sensible (?) values (i.e., vnum = -1.0263e+09 and fnum  =  -1.0529e+09). The same code produces no error when run on the same pial surface extracted with a different version of freesurfer (freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c) in a different Ubuntu environment (Ubuntu 16.04 LTS).

As visual inspection in Freeview of the 2 surfaces from the two different Freesurfer versions reveals no obvious differences, I am therefore at a loss as where exactly to start to fix this problem and would be grateful for any help.

Many thanks!
Darinka

--
Darinka Trübutschek, PhD

Department of Experimental Psychology
Anna Watts Building
Radcliffe Observatory Quarter
Woodstock Road
Oxford, OX2 6GG
UK

website: https://sites.google.com/site/dtruebutschek/
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190501/f7bd4705/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list