vertices/source location

Hello,

I am trying to better understand how the stc vertices can be identified
using source location information. Can I identify the vertices using the
break down of the inverse operator (the vertex locations or the vertex
normals)? I see that the inverse operator has 2 src structs, is one for
the left hemisphere and the other for the right?

Thanks,
-Ricky

Hi,
I have written a matlab function that reads vertices and faces information
from the inv operator. Hope it will help you.

Feel free if you have any questions.

Sheraz Khan
Martinos Center

%--------------------------------------------------------
function [Faces Vertices]=tess_From_inverse(inv,side)

% Inputs
    % inv: inverse operator from mne
    % inv=mne_read_inverse_operator('file_name_inverse_operator');
    % side='left';'right';'both'

% Output
    %Faces of tessalation
    %Vertices of Tessaltion

% Usage
    % [Faces Vertices]=tess_From_inverse(inv,side)

% Sheraz Khan, Ph.D.
% sheraz at nmr.mgh.harvard.edu
% Creation:: Oct 06, 2010

if strcmp(side,'left') || strcmp(side,'both')

vertexNumber=inv.src(1).vertno;

Vertices=inv.src(1).rr;

FacesOrignal=inv.src(1).use_tris;

FacesL=zeros(size(FacesOrignal));
for i=1:size(FacesL,2)

    for j=1:size(FacesL,1)

      FacesL(j,i)=find(vertexNumber==FacesOrignal(j,i));

    end

end

VerticesL=Vertices(vertexNumber,:);

FacesL=int32(FacesL);

end

if strcmp(side,'right') || strcmp(side,'both')
vertexNumber=inv.src(2).vertno;

Vertices=inv.src(2).rr;

FacesOrignal=inv.src(2).use_tris;

FacesR=zeros(size(FacesOrignal));
for i=1:size(FacesR,2)

    for j=1:size(FacesR,1)

      FacesR(j,i)=find(vertexNumber==FacesOrignal(j,i));

    end

end

VerticesR=Vertices(vertexNumber,:);

FacesR=int32(FacesR);

end

if strcmp(side,'both')

Vertices=[VerticesL;VerticesR];

Faces=[FacesL;(FacesR+inv.src(1).nuse)];

elseif strcmp(side,'left')
Vertices=VerticesL;
Faces=FacesL;

elseif strcmp(side,'right')
Vertices=VerticesR;
Faces=FacesR;

end

%----------------------------------------------------------------------