MNI to vertex?

What's the best way to get the vertex number nearest to a set of MNI
coordinates in a volume source space? The functions for volume source
spaces (e.g, tf_lcmv) expect labels but I'm not sure how to construct a
label for a region outside of the cortical sheet, other than simply filling
in the vertex numbers.

Thanks

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140308/cccedf33/attachment.html

hi Jon,

there is no support for labels/ROIs for volume source spaces.
I would use freeview and freesurfer tools to explore volume estimates.
Did you consider using a surface source space with LCMV?

Alex

Hi Alex,

I did, but I'm looking at sources not contained in the surface source space
(i.e., cerebellum). All I really want to do is extract the raw source
timecourse for a given set of MNI coordinates, for use in time frequency
analysis, coherence, etc. I suppose it would be possible to go through the
file with lcmv_raw and drop the vertices of no interest (?99%) from each
time sample prior to saving, but that would be kind of a kludge.

For now it's just a handful of subjects, I can always do it in Graph with
an SSP as my spatial filter.

Thanks

Jon

hi jon,

I did, but I'm looking at sources not contained in the surface source space
(i.e., cerebellum). All I really want to do is extract the raw source
timecourse for a given set of MNI coordinates, for use in time frequency
analysis, coherence, etc. I suppose it would be possible to go through the
file with lcmv_raw and drop the vertices of no interest (?99%) from each
time sample prior to saving, but that would be kind of a kludge.

how did you generate the source space with the cerebellum?

I am afraid there is no simple solution to your problem. You'll need to
hack something and ideally share your progress so it can benefit to
others. The clean solution would be to write a grow_label function
that would work with a volume source space ... there is a bit of work...

For now it's just a handful of subjects, I can always do it in Graph with an
SSP as my spatial filter.

not as nice but if it works...

A

I'd use a kd-tree for this. If you have a list of vertices in b:

import numpy as np
from scipy.spatial import KDTree

b = np.zeros((nv, 3))
  ... fill in b ...
k = KDTree(b)

Now, e.g., k.query_ball_point(b[j,:], 2.) will return a list of indices
for vertices within 2. units. You can query any (x,y,z) point and get
a list of nearby vertices.

Jon Houck wrote: