# Understanding source spaces

**URL:** <https://mne.discourse.group/t/understanding-source-spaces/2982>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, visualization\
**Created:** [April 13, 2021, 4:07pm UTC](https://mne.discourse.group/t/understanding-source-spaces/2982 "2021-04-13T16:07:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teekuningas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/teekuningas/32/48_2.png) [@Teekuningas](https://mne.discourse.group/u/Teekuningas)\
**Post date:** [April 13, 2021, 4:07pm UTC](https://mne.discourse.group/t/understanding-source-spaces/2982/1 "2021-04-13T16:07:49Z")

</div>

Hello,

I was trying to understand how forward solutions, labels, source spaces and surfaces relate and tried something really simple:

```python
import mne
from surfer import Brain

data_path = mne.datasets.sample.data_path()
subjects_dir = data_path + '/subjects'
subject = 'fsaverage'

# read forward solution
fname_fwd = data_path + '/MEG/sample/sample_audvis-meg-oct-6-fwd.fif'
fwd = mne.read_forward_solution(fname_fwd)
src = fwd['src']

# I assume this is how I get the indices for vertices that span the left hemisphere
vertices = src[0]['vertno']

# let's say I want to take the leftmost ones
vertices = [vv for vv in vertices if src[0]['rr'][vv, 0] < -0.06]

# and create a label based on them
label = mne.Label(vertices, hemi='lh', name='leftmost', subject=subject)

# save to annot
mne.write_labels_to_annot(
    [label], subject=subject, hemi='lh',
    parc='leftparc', subjects_dir=subjects_dir, overwrite=True)

# create brain for plotting
brain = Brain('fsaverage', 'lh', 'inflated', subjects_dir=subjects_dir, alpha=0.999)

# and add from saved annot
brain.add_annotation('leftparc')

```

Can anyone explain why I am getting dots all over the surface instead of getting the leftmost area?

 ![surfacespotting](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/5851782325c2a8484b2cbfbf7cf4ebfa6719cda4.jpeg)

Thanks in advance,  
Erkka

---

<div class="post-metadata">

**Author:** ![Teekuningas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/teekuningas/32/48_2.png) [@Teekuningas](https://mne.discourse.group/u/Teekuningas)\
**Post date:** [April 14, 2021, 6:21am UTC](https://mne.discourse.group/t/understanding-source-spaces/2982/2 "2021-04-14T06:21:26Z")

</div>

Haha, mixed sample and fsaverage. Everything works fine.

Sorry,  
– Erkka
