# plotting vertices/sources in the brain

**URL:** <https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, visualization\
**Created:** [August 19, 2021, 2:33pm UTC](https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569 "2021-08-19T14:33:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vss245](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/vss245/32/777_2.png) [@vss245](https://mne.discourse.group/u/vss245)\
**Post date:** [August 19, 2021, 2:33pm UTC](https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569/1 "2021-08-19T14:33:27Z")

</div>

I have a list of locations in an array (of the shape array([[-56.452962, -47.393728, 3.289199], etc) that I’m trying to plot on a 3D brain using mne.viz.Brain.

The code is as follows:

```python
from mne.datasets import fetch_fsaverage
import os.path
fs_dir = fetch_fsaverage(verbose=True)
subjects_dir = os.path.dirname(fs_dir)
subject = 'fsaverage'
import mne
mne.viz.set_3d_backend("pyvista")
subjects_dir = mne.datasets.sample.data_path() + '/subjects'
Brain = mne.viz.get_brain_class()
brain = Brain('sample', hemi='both', surf='pial',cortex='classic',
              subjects_dir=subjects_dir, alpha = 0.2, size=(800, 600))
brain.add_foci(data, hemi='rh',color='blue')

```

I have two questions:

1. I’m not sure what coordinate space my data is in and judging by the plots, it might be wrong but I’m not sure how to adjust it.
2. the “data” array has locations in both hemispheres, but I can only add the foci if I specify left or right, why can’t I specify “both” hemispheres?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [August 22, 2021, 9:12am UTC](https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569/2 "2021-08-22T09:12:45Z")

</div>

Hello @vss245 and welcome to the forum!

> [@vss245](#):
>
> - I’m not sure what coordinate space my data is in and judging by the plots, it might be wrong but I’m not sure how to adjust it.

I don’t understand the question. To convert your data into a different coordinate system, you will have to apply some sort of transformation. Without knowing the source coordinate system, there’s no way to know if and which transform to apply.

> [@vss245](#):
>
> 1. the “data” array has locations in both hemispheres, but I can only add the foci if I specify left or right, why can’t I specify “both” hemispheres?

I believe this is a limitation inherited from FreeSurfer, which treats the hemispheres separately.

* * *

Have you had a look at the [`Label` class](https://mne.tools/stable/generated/mne.Label.html)? I believe this could be what you need.

---

<div class="post-metadata">

**Author:** ![vss245](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/vss245/32/777_2.png) [@vss245](https://mne.discourse.group/u/vss245)\
**Post date:** [August 23, 2021, 6:23pm UTC](https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569/3 "2021-08-23T18:23:15Z")

</div>

hi Richard, thanks for the answers. I assumed that MNE might account for some standard coordinate spaces (e.g. MNI, Talaraich) that I can explicitly set when plotting, but I will try to find out the coordinate system of my data by cross-checking it against atlases or something like that. thanks for the answer on the hemispheres point and I will try the Label class!

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 23, 2021, 6:47pm UTC](https://mne.discourse.group/t/plotting-vertices-sources-in-the-brain/3569/4 "2021-08-23T18:47:23Z")

</div>

> [@vss245](#):
>
> I assumed that MNE might account for some standard coordinate spaces (e.g. MNI, Talaraich) that I can explicitly set when plotting

MNE-Python internally stores everything in SI units, which for source locations means the units are meters. The coordinate frame is usually “head” which is a Right-Anterior-Superior frame defined by the cardinal anatomical points (nasion, left- and right-preauricular points). Much more info can be found here:

[https://mne.tools/stable/auto\_tutorials/forward/20\_source\_alignment.html](https://mne.tools/stable/auto_tutorials/forward/20_source_alignment.html)
