# Are there anyway to select a label or vertex according to position coordinates?

**URL:** <https://mne.discourse.group/t/are-there-anyway-to-select-a-label-or-vertex-according-to-position-coordinates/10885>\
**Category:** Support & Discussions\
**Created:** [March 6, 2025, 3:41am UTC](https://mne.discourse.group/t/are-there-anyway-to-select-a-label-or-vertex-according-to-position-coordinates/10885 "2025-03-06T03:41:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luessiaw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/luessiaw/32/3978_2.png) [@Luessiaw](https://mne.discourse.group/u/Luessiaw)\
**Post date:** [March 6, 2025, 3:41am UTC](https://mne.discourse.group/t/are-there-anyway-to-select-a-label-or-vertex-according-to-position-coordinates/10885/1 "2025-03-06T03:41:54Z")

</div>

- MNE version: 1.8.0
- operating system: Windows11

Hi everyone, I’m trying to put a simulated signal on a specific position in brian, but I don’t know how to relate the coordinates to `Label` object. ChatGPT suggests me to use `mne.vertex_to_mni` and `mne.grow_labels` , as shown below

```python
import mne
from mne import vertex_to_mni, grow_labels

dipole_pos = [0.05, -0.03, 0.06] 
vertex_idx, _ = mne.source_space.head_to_mni(
    dipole_pos,  
    subject='sample',  
    subjects_dir=subjects_dir 
)

label = mne.grow_labels(
    subject='sample',  
    subjects_dir=subjects_dir, 
    hemi='lh',
    vertices=[vertex_idx],
    n_jobs=1
)

```

However, I run the script and got an `AttributeError: No mne.source_space attribute head_to_mri`. I searched `head_to_mni` in mne’s document and found `mne.head_to_mni`, but according to the documnet this function just transforms the coordinates and cannot give me the label or vertex.

So, **are there anyway to select a label or vertex according to position coordinates?** Thanks!

---

<div class="post-metadata">

**Author:** ![okapi](https://avatars.discourse-cdn.com/v4/letter/o/da6949/32.png) [@okapi](https://mne.discourse.group/u/okapi)\
**Post date:** [March 6, 2025, 11:17pm UTC](https://mne.discourse.group/t/are-there-anyway-to-select-a-label-or-vertex-according-to-position-coordinates/10885/2 "2025-03-06T23:17:56Z")

</div>

Hi, for a similar task, I applied mne.vertex\_to\_mni to a label/hemisphere which gave coordinates for each vertex. Then you can find a minimal error for x,y,z coordinates with the coordinate you have (need to be in MNI305 coordinate system too). But check that the result is reasonable, of course.
