For a volume, I would do it differently. In matlab

[segcodes segnames ] = read_fscolorlut(); % read in the seg lookup table

aparcaseg = MRIread('aparc+aseg.mgz'); % Load in the volume
crs = round(inv(aparcaseg.tkrvox2ras)*[tkr tka tks 1]')+1; % convert 
your tkreg coords to col, row, and slice
c = crs(1);
r = crs(2);
s = crs(3);
segno = aparcaseg.vol(r,c,s); % extract the segmentation number
ind = find(segno == segcodes); % convert to the ne name of the segmentation
segname = segnames(ind,:)


On 2/20/19 9:58 AM, Sparsh Jain wrote:
>
>         External Email - Use Caution
>
> Hi Doug,
>
> I tried what you suggested, but it did not work (see below for details 
> of what we tried). We have TkReg RAS coordinates (or vertex points) 
> for our electrode contacts; most contacts are _deep within the 
> brain_ (e.g., hippocampus and amygdala). We want to get a variable in 
> Matlab that will give us the anatomical labels as a function of the 
> TkReg RAS coordinates (or vertex points). How can we do this?
>
> Thanks!
>
> Sparsh
>
> _What I tried:_ I read the 'rh.aparc.2009a.annot' file in matlab using 
> read_annotation.m. That gave me 76 labels for right hemisphere, which 
> I believe correspond to the surface parcellations only. In freeview I 
> loaded the orig.mgz, aparc.a2009s+aseg.mgz, rh.pial and rh.inflated. I 
> then clicked on a cortical surface point to see if I can get the 
> corresponding vertex number or structure ID. On doing so, I found a 
> value in the Vertex row under rh.pial of freeview but this number 
> wasn't found in the matlab output (in the colortable.label or 
> colortable.table). I think I am looking in the wrong place to find the 
> vertex # on freeview.
>
> Also, I did not find a readable file for the segmentation data. I 
> tried to read the aparc.a2009s+aseg.mgz on Matlab but that didn't work.
> Show quoted text
>
> On Thu, 7 Feb 2019, 16:10 Greve, Douglas N.,Ph.D. 
> <dgr...@mgh.harvard.edu <mailto:dgr...@mgh.harvard.edu> wrote:
>
>     First, you'll have to find the closest vertex for each point in
>     fsavarage. You can do this with by creating a label file then using
>     mri_label2label with the --paint option.
>
>     To find the label associated with each vertex, it is  probably
>     easiest
>     to use matlab using read_surf.m and read_annotation.m
>
>     On 2/5/19 11:17 AM, Sparsh Jain wrote:
>     >
>     >         External Email - Use Caution
>     >
>     > Good afternoon
>     >
>     > Is there is way to automatically extract the anatomical locations
>     > corresponding to a set of RAS coordinates using Freesurfer's
>     atlas? I
>     > have a set of 200 points and I am trying to get their anatomical
>     > labels automatically.
>     >
>     > Thank you
>     > Sparsh
>     >
>     > _______________________________________________
>     > Freesurfer mailing list
>     > Freesurfer@nmr.mgh.harvard.edu
>     <mailto:Freesurfer@nmr.mgh.harvard.edu>
>     > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
>     _______________________________________________
>     Freesurfer mailing list
>     Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
>     https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Reply via email to