# Simulate activity in subcortical structures using	MNE python?

**URL:** <https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [October 18, 2017, 10:44pm UTC](https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334 "2017-10-18T22:44:40Z")\
**Posts on this page:** 4\
**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:** [October 18, 2017, 10:44pm UTC](https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334/1 "2017-10-18T22:44:40Z")

</div>

Hello, I would like to simulate activity in amygdala using MNE. I have not  
been able to find a method to do this in the documentation. Is this  
possible at this time?  
Many thanks,  
Lori

---

<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:** [October 22, 2017, 3:29pm UTC](https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334/2 "2017-10-22T15:29:20Z")

</div>

hi Lori,

yes it should be possible but there is no such example.

a good place to start is:

[https://martinos.org/mne/stable/auto\_examples/inverse/plot\_mixed\_source\_space\_inverse.html](https://martinos.org/mne/stable/auto_examples/inverse/plot_mixed_source_space_inverse.html)

to make a source space

then you need to simulate.

sorry I don't have enough time to help you more right now

Alex

---

<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:** [October 23, 2017, 9:39pm UTC](https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334/3 "2017-10-23T21:39:45Z")

</div>

Hi Alex, thanks, I do have that part worked out. I have everything set up  
(mixed source space, fwd, inv, labels) and was trying to use:

stc = simulate\_sparse\_stc(fwd['src'], n\_dipoles=1, times=times,  
labels=label\_ts[0][69, :])

&nbsp;&nbsp;and get the error message:

&nbsp;&nbsp;File  
"/export/mialab/users/lsanfratello/python\_anaconda/anaconda2/lib/python2.7/site-packages/mne/simulation/source.py",  
line 73, in select\_source\_in\_label  
&nbsp;&nbsp;&nbsp;&nbsp;if label.hemi == 'lh':  
AttributeError: 'numpy.float64' object has no attribute 'hemi'

Any chance there is a simple remedy?  
Thanks,  
Lori

---

<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:** [October 24, 2017, 7:05am UTC](https://mne.discourse.group/t/simulate-activity-in-subcortical-structures-using-mne-python/1334/4 "2017-10-24T07:05:55Z")

</div>

Hi Lori,

Based on the error, your label\_ts-variable isn?t what mne is expecting. From the docstring of simulate\_sparse\_stc:

&nbsp;&nbsp;&nbsp;&nbsp;labels : None | list of Labels  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The labels. The default is None, otherwise its size must be n\_dipoles.

How did you create label\_ts? Generally speaking, a little more context would be helpful to determine where the problem lies. I strongly recommend using ?gist?s for this ([https://gist.github.com](https://gist.github.com))?you can copy-paste code in there and send the link to a mailing list like this one.

/Chris
