09/24/2018 at 6:30 AM
#5489
andreashorn
Keymaster
Hi Anthony,
you can do so by averaging the vertices of the atlas surface I think:
lead path
load([ea_space([],'atlases'),'DISTAL Minimal (Ewert 2017)',filesep,'atlas_index.mat']);
centroid=mean(atlases.fv{1,1}.vertices);
would calculate the centroid of the right STN (11.2668 -12.6726 -7.7385) of the DISTAL atlas.
With
atlases.names
you can see the entries of the atlas set.
In this case, STN is the first one.
In Lead-DBS, right hemisphere is always entry number one, left is number two.
So replacing the third line with
centroid=mean(atlases.fv{5,2}.vertices);
would give you the left GPi (GPi is entry number 5, 2 stands for the left side.
Hope this helps,
best, Andy