External Email - Use Caution
Dear freesurfer,
I am trying to import surface files into MATLAB and highlight a selected
vertex on it. I am getting the coordinates from FreeView and then trying to
find the same position in my matlab plot using the RAS surface coordinates.
My code works perfectly for lh.pial but not for lh.inflated. Is lh.inflated
transformed in FreeView? Why doesn't my method work the same for the
inflated surface? How can I fix this?
HIGHLIGHT vertex '80609' on INFLATED SURFACE in matlab
%Vertex 80609 on /subject/bert/surf/lh.inflated;
% FROM FREEVIEW :
%lh.pial = [-39.45, 8.55, 50.40] = Surface RAS
%lh.inflated = [-37.02, 8.26, 48.41] = Surface RAS
[vertices, faces] = freesurfer_read_surf(
'/Applications/freesurfer/7.3.2/subjects/bert/surf/lh.inflated');
% Plot the rotated surface data
patch('Faces', faces, 'Vertices', vertices, 'FaceColor', [0.5 0.5 0.5],
'EdgeColor', 'none');
% Hp = patch('vertices',vertices,'faces',faces(:,[1 3 2]));
camlight('headlight','infinite');
title('Left hemisphere of the cortex (file = lh.pial) with a point
overlayed in FreeSurfer Surface RAS Coordinate System')
xlabel('R')
ylabel('A')
zlabel('S')
hold on;
str=sprintf('Vertex A');
label1=str;
vertexA=[-37.02, 8.26, 48.41];
plot3(vertexA(1), vertexA(2), vertexA(3), '*r');
text(vertexA(1),vertexA(2), vertexA(3),label1,'Color','r', 'FontSize',20,
'VerticalAlignment','bottom','HorizontalAlignment','left');
Any help would be greatly appreciated,
Thanks!
Sarah