<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear fieldtrip community,</div><div><br></div><div>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:</div><div><br></div><div>pial = ft_read_headshape('freesurfer/surf/lh.pial');<br>Error using fread<br>Invalid size.<br><br>Error in read_surf (line 72)<br>  vertex_coords = fread(fid, vnum*3, 'float32') ;<br><br>Error in ft_read_headshape (line 909)<br>    [pos, tri] = read_surf(filename);<br></div><div><br></div><div>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). <br></div><div><br></div><div>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, however, both of these surfaces look qualitatively similar in freeview, I am at a loss at where exactly to start to fix the above problem and would be grateful for any help.</div><div><br></div><div>Many thanks,</div><div>Darinka<br></div><div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="tahoma, sans-serif">Darinka Trübutschek, PhD</font></div><div dir="ltr"><font face="tahoma, sans-serif"><br></font><div><div>Department of Experimental Psychology</div><div>Anna Watts Building</div><div>Radcliffe Observatory Quarter</div><div>Woodstock Road</div><div>Oxford, OX2 6GG</div><div>UK</div></div><div><font face="tahoma, sans-serif"><br></font></div><div><font face="tahoma, sans-serif">website: <a href="https://sites.google.com/site/dtruebutschek/" target="_blank">https://sites.google.com/site/dtruebutschek/</a></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>