# How to correctly mapping SourceEstimate to brain atlas？

**URL:** <https://mne.discourse.group/t/how-to-correctly-mapping-sourceestimate-to-brain-atlas/6739>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, meg\
**Created:** [April 18, 2023, 12:13pm UTC](https://mne.discourse.group/t/how-to-correctly-mapping-sourceestimate-to-brain-atlas/6739 "2023-04-18T12:13:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshlyz](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jshlyz](https://mne.discourse.group/u/jshlyz)\
**Post date:** [April 18, 2023, 12:13pm UTC](https://mne.discourse.group/t/how-to-correctly-mapping-sourceestimate-to-brain-atlas/6739/1 "2023-04-18T12:13:55Z")

</div>

- MNE version:1.3.0
- operating system: Ubuntu 18.04  
Hi all,  
I have a problem with mapping SourceEstimate to HCP-MMP atlas. I already got the SourceEstimate（subject=‘fsaverage’，source\_spaces from fsaverage-ico-5-src.fif）

> stc\_fs = mne.read\_source\_estimate(stc\_fs\_fname, subject=‘fsaverage’)  
> fname\_src\_fsaverage\_sur = ‘/usr/local/freesurfer/subjects/fsaverage/bem/fsaverage-ico-5-src.fif’  
> src\_fs\_sur = mne.read\_source\_spaces(fname\_src\_fsaverage\_sur)  
> stc\_fs.plot(hemi=‘both’, views=‘axial’, subjects\_dir=fs\_root,subject=‘fsaverage’)

This is the plot above:

 ![b1](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/6/63f58e2b9594ad2c4b0cc71396f6ef65057c4a23.png)

then I try to run the following code to mapping SourceEstimate to HCP-MMP atlas:

> mne.datasets.fetch\_hcp\_mmp\_parcellation(subjects\_dir=fs\_root,verbose=True)  
> labels = mne.read\_labels\_from\_annot(‘fsaverage’, parc=‘HCPMMP1’, subjects\_dir=fs\_root)  
> course\_mean\_flip = mne.extract\_label\_time\_course(stc\_fs, labels, src\_fs\_sur, mode=‘mean\_flip’, allow\_empty=True)

The course\_mean\_flip is a numpy.ndarray with size of (360, 1).I plot the course\_mean\_flip find it is very different from stc\_fs :

 ![微信图片_20230418195310](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/3/30a008075dafc7ced46697216543cb993e0a79f4.png)

Is the method I used to map SourceEstimate to MMP atlas correct? Why do the results differ so much? I also checked the course\_mean\_flip data, all 360 values are not zero, which will activate the entire brain. But why are all 20484 values of stc\_fs.data not 0, and the plot result values only showing few activation?

One more question, I don’t know the [‘vertno’] meaning in the fsaverage-ico-5-src.fif source space file used by fsaverage. I use mne.read\_source\_spaces to read this file and get:

> \<SourceSpaces: [\<surface (lh), n\_vertices=163842, n\_used=10242\>, \<surface (rh), n\_vertices=163842, n\_used=10242\>] MRI (surface RAS) coords, subject ‘fsaverage’, ~21.9 MB\>

SourceSpaces[‘vertno’] is the array([0, 1, 2, …, 10239, 10240, 10241]),Why is this index sequential? Why is it not the mapping between 10242 n\_vertices vertices to 163842 vertices?  
Because I check

> labels = mne.read\_labels\_from\_annot(‘fsaverage’, parc=‘HCPMMP1’, subjects\_dir=fs\_root)，

labels[0].vertices is the array([8,23,36, …, 163617, 163618, 163619]). I dont know why the vertno from fsaverage source space and the vertices in fsaverage atlas are inconsistent

I hope someone can help me, I have been troubled for a very long time, thank you very much！

---

<div class="post-metadata">

**Author:** ![dasdiptyajit](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dasdiptyajit/32/4796_2.png) [@dasdiptyajit](https://mne.discourse.group/u/dasdiptyajit)\
**Post date:** [April 20, 2023, 7:13pm UTC](https://mne.discourse.group/t/how-to-correctly-mapping-sourceestimate-to-brain-atlas/6739/2 "2023-04-20T19:13:08Z")

</div>

@jshlyz unfortunately, your description is quite volatile and its rather difficult to understand what exactly you are trying to do.

To understand the structure of the `SourceEstimate file (.stc)`, have a look here:  
[https://mne.tools/dev/auto\_tutorials/inverse/10\_stc\_class.html](https://mne.tools/dev/auto_tutorials/inverse/10_stc_class.html)

To know more about `mne.extract_label_time_course`, see the following use case:  
[https://mne.tools/stable/auto\_examples/inverse/label\_source\_activations.html#sphx-glr-auto-examples-inverse-label-source-activations-py](https://mne.tools/stable/auto_examples/inverse/label_source_activations.html#sphx-glr-auto-examples-inverse-label-source-activations-py)

To visualize the `SourceEstimate` object, have a look here:  
[https://mne.tools/stable/auto\_tutorials/inverse/60\_visualize\_stc.html](https://mne.tools/stable/auto_tutorials/inverse/60_visualize_stc.html)

To plot the parcellation (`HCPMMP1`), have a look here:  
[https://mne.tools/dev/auto\_examples/visualization/parcellation.html](https://mne.tools/dev/auto_examples/visualization/parcellation.html)

I hope this will help you to navigate your issues in general.

best,  
Dip

---

<div class="post-metadata">

**Author:** ![SilvanaHuertas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/silvanahuertas/32/3030_2.png) [@SilvanaHuertas](https://mne.discourse.group/u/SilvanaHuertas)\
**Post date:** [October 29, 2024, 6:42am UTC](https://mne.discourse.group/t/how-to-correctly-mapping-sourceestimate-to-brain-atlas/6739/3 "2024-10-29T06:42:18Z")

</div>

Hi, where you able to do this at the end? I’m trying to do something similar and I haven’t been able either.
