Dear FreeSurfer Developers,
     I think there is a bug in FreeSurfer's MATLAB code that is used to compute the local gyrification index. Specifically, when I run this command:

recon-all -s PT001 -localGI


I get the following error:

face 115000 / 118360

mesh_outer =

         vertices: [59182x3 double]
            faces: [118360x3 double]
    facesOfVertex: [59182x1 struct]

preparing pial mesh structure ...
...searching for mesh edges...done (171.44 sec).
... creating path file for vertex 1 / 59182
area file for outer ROIs saved at 1
In an assignment  A(:) = B, the number of elements in A and B must be the same.

Error in dsearchn (line 79)
        [d(i),t(i)] = min(sum((x-yi).^2,2));

Error in mesh_vertex_nearest (line 29)
nearestIndex = dsearchn(vertices,points);

Error in reorganize_verticeslist (line 28)
    [nextindex,nextvalue]=mesh_vertex_nearest(mesh_total.vertices(remaininglist,:),mesh_total.vertices(verticeslist(start_vertex),:));
   
Error in make_roi_paths (line 93)
    reorglist = reorganize_verticeslist (mesh_total, A, mesh_outer, perim,
    verticeslist, step);

 
>>
ERROR:  make_roi_paths did not complete successfully!

I ran the command in debugging mode and x and yi are both empty variables.

I am using a freshly installed version of the Lion OS X 10.7 (64b Intel) version of FreeSurfer (freesurfer-Darwin-lion-stable-pub-v5.3.0.dmg; freesurfer-Darwin-lion-stable-pub-v5.3.0) and am running on OS 10.11.6 using MATLAB version R2015b (8.6.0.267246). The recon-all.log is attached.

Let me know if there is any further information I can provide and thanks for producing such a fantastic piece of freeware.
     -David Groppe