Back to the main page.

Bug 2168 - ft_read_headshape is inconsistent with reading from one or multiple freesurfer files

Reported 2013-05-14 17:21:00 +0200
Modified 2019-08-10 12:03:03 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Irina
Depends on:
See also:

Irina - 2013-05-14 17:21:36 +0200

if the input is a cell array, it reads one or multiple files, including the curvature. If the input is a string, it reads a single file. Better would be to make the cell-array handling (i.e. concatenating over multiple files) independent from the input format. E.g. if iscell(filename) % step 1: read all inputs, one by one bnd = cell(size(filename)); for i=1:length(filename) bnd{i} = ft_read_headshape(filename{i}, varargin{:}); end % step 2: concatenate ... end and then move the sections that are specific to curv and sulc and to lh/rh inflated handling to the "case freesurfer" section down in the code. In the end the following should result in identical outputs bnd1 = ft_read_headshape('lh.inflated') bnd2 = ft_read_headshape({'lh.inflated'}) this will also allow concatenation of mat and gifti files.

Jan-Mathijs Schoffelen - 2013-05-14 17:32:32 +0200

I guess the fileformat of .curv and .sulc are the same, they just represent different things. I guess the .sulc represent the sulculsness of a vertex, and the .curv represent the local curvature (as scalar value?). Perhaps we should check the freesurfer wiki for this.

Robert Oostenveld - 2013-05-14 21:06:27 +0200

(In reply to comment #1) Uw zoekbewerking - sulculsness - heeft geen overeenkomstige documenten opgeleverd. ;-) But luckily the answer exists at "in a nutshell, the difference is that the 'curv' files contain information about curvatures, and the 'sulc' files contain information about displacement"

Irina - 2013-05-15 15:28:53 +0200

WRT the concatenation of left and right hemispheres: I updated the function; it now reads multiple files if the input is a cell array. However, it would only concatenate the parts if you add an option "concatenate" = 'yes' Otherwise, It would just return a structure like this: shape = 1x2 struct array with fields: pnt tri sulc curv unit

Irina - 2013-05-15 15:30:10 +0200

(In reply to comment #3) I didn't commit it yet....

Irina - 2013-06-05 16:45:41 +0200

committed version 8193

Robert Oostenveld - 2019-08-10 12:03:03 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on