Dear all,

I need to compute the geodesic distance (i.,e. the distance on the cortical surface) between a series of vertices. Specifically, I want to compute the distance between all the vertices in the right hemisphere (>100000) and a series of vertices of interest (around 20000), always located in the right hemisphere. Ideally, my output should be a matrix right_verticesXvertices_of_interest where in each entry there is the geodesic distance between the pair of vertices. And I need to do this for hundreds of subjects!

I tried to use mris_pmake:

for i = right_vertices;

    for j=vertices_of_interest;

    command1 = ['/Applications/freesurfer_v5.3/bin/mris_pmake --subject 001 --hemi rh --surface0 white --curv0 sulc --curv1 sulc --mpmOverlay euclidean --mpmProg pathFind --mpmArgs startVertex:' num2str(i) ',' 'endVertex:' num2str(j)]

    T(i)=evalc('system([command1])')

    end

end


But the problem is that it is way too much time consuming and it is difficult to store the results in a matrix.


Is there a way to adapt this command for such high computations? I 

Are there other ways to obtain the geodesic distance between vertices, either than mris_pmake (for example a matlab function)?


Thank you in advance,

Marica