# source space vertices locations

**URL:** <https://mne.discourse.group/t/source-space-vertices-locations/981>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 29, 2016, 11:59am UTC](https://mne.discourse.group/t/source-space-vertices-locations/981 "2016-03-29T11:59:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 11:59am UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/1 "2016-03-29T11:59:30Z")

</div>

Hi all,

I'm curious about how to select vertices based on their overall location.  
For example, say I have found two peaks in my source estimates. I want to  
build two functional labels for each. One blob is in the anterior half and  
the other is in the posterior half of the left hemisphere. Are the vertices  
organized in such away that I can select each blob on the basis of its  
overall location in the brain?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 12:20pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/2 "2016-03-29T12:20:10Z")

</div>

You can do this in mne\_analyze by simply drawing around the ROI, and  
selecting (the procedure is described in the manual). You can also do  
this programmatically in the mne-python code (this is a good starting  
point: [http://martinos.org/mne/stable/auto\_examples/inverse/plot\_label\_from\_stc.html?highlight=label](http://martinos.org/mne/stable/auto_examples/inverse/plot_label_from_stc.html?highlight=label)  
). or with a simple bit of self-written matlab/python code depending  
on your needs.

hth  
d

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 1:13pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/3 "2016-03-29T13:13:11Z")

</div>

I have been working off of that example that you linked in. The  
mne.stc\_to\_label is very useful and gets me part of the way there but I  
still can't say which is anterior and which is posterior until I plot them.  
Which is fine with two labels but could get complicated with more (or to  
iterate across many subjects). If I can avoid the manual option, that'd be  
great.

Really all I'm looking for is access to the spatial location of each vertex  
in some kind of xyz coordinate space. With that, the rest is, as you  
mentioned, a bit of simple self-written code but I haven't been able to  
find any documentation on how the vertices are sorted or structured.

Thanks!

Keith

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 1:17pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/4 "2016-03-29T13:17:19Z")

</div>

Hi Keith,

The xyz coordinate for each vertex is in the source space. you can  
just calculate anterior vs. posterior using the locations there.

hth  
d

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 1:33pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/5 "2016-03-29T13:33:10Z")

</div>

Thanks for bearing with me.

Based on shape, It seems as though they are in either the 'nn' or 'rr' keys  
of the source space dict. Maybe this is obvious, but what is the difference  
between these?

After that I can use vertno to select the correct vertices?

Keith

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 1:44pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/6 "2016-03-29T13:44:54Z")

</div>

rr is what you want.

In the pdf manual you would find the description in the matlab toolbox  
chapter (there is a description of all the fields). I haven't been  
able to find these things after the C-manual was removed from the wiki  
(it is probably there, but I don't know the new layout).

hth  
d

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 29, 2016, 2:06pm UTC](https://mne.discourse.group/t/source-space-vertices-locations/981/7 "2016-03-29T14:06:10Z")

</div>

look at that! There is a manual!

Thanks for your help!  
Keith
