[Mne_analysis] MNI to vertex?
Tom Holroyd (NIH/NIMH) [E]
tomh at kurage.nimh.nih.gov
Mon Mar 10 14:20:56 EDT 2014
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:
> What's the best way to get the vertex number nearest to a set of MNI
> coordinates in a volume source space?
--
Dr. Tom
--
I tell you: one must still have chaos in oneself, to give birth to a
dancing star. I tell you: you have still chaos in yourselves.
Thus spoke Zarathustra.
More information about the Mne_analysis
mailing list