# Generate a functional label from source estimates in	rh or both

**URL:** <https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 5, 2014, 9:40pm UTC](https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683 "2014-03-05T21:40:49Z")\
**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:** [March 5, 2014, 9:40pm UTC](https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683/1 "2014-03-05T21:40:49Z")

</div>

When I attempt to create a functional label using the example  
script\<[http://martinos.org/mne/stable/auto\_examples/inverse/plot\_label\_from\_stc.html#example-inverse-plot-label-from-stc-py](http://martinos.org/mne/stable/auto_examples/inverse/plot_label_from_stc.html#example-inverse-plot-label-from-stc-py)\>in  
the lh, it works well on my data. I am, however, having a lot of  
trouble  
getting the rh or both hemispheres to work. Specifically, when I specify  
'rh' or 'both' for hemi, I get an empty result for

func\_labels, \_ = mne.stc\_to\_label  
\<[http://martinos.org/mne/stable/generated/mne.stc\_to\_label.html#mne.stc\_to\_label](http://martinos.org/mne/stable/generated/mne.stc_to_label.html#mne.stc_to_label)\>(stc\_mean\_label  
\<[http://martinos.org/mne/stable/generated/mne.SourceEstimate.html#mne.SourceEstimate](http://martinos.org/mne/stable/generated/mne.SourceEstimate.html#mne.SourceEstimate)\>,  
src=src, smooth=5,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subjects\_dir=subjects\_dir, connected=True)

Do I have to do some function calls not in the example to get rh or both to  
work?

thanks,  
Matt  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140305/8d8eb883/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140305/8d8eb883/attachment.html)

---

<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:** [March 5, 2014, 9:44pm UTC](https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683/2 "2014-03-05T21:44:03Z")

</div>

Hi Matt,

could you share a snippet based on the sample data so we can reproduce the  
problem?  
I've recently used this function a lot for both hemispheres (after setting  
the sub-threshold vertices to zero).

Best,  
Denis

---

<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:** [March 5, 2014, 10:19pm UTC](https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683/3 "2014-03-05T22:19:26Z")

</div>

Here's a gist for that. \<[https://gist.github.com/mattjerhart/9377713](https://gist.github.com/mattjerhart/9377713)\>  
Thanks!

---

<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:** [March 6, 2014, 9:04pm UTC](https://mne.discourse.group/t/generate-a-functional-label-from-source-estimates-in-rh-or-both/683/4 "2014-03-06T21:04:37Z")

</div>

hi Matt,

I have not tried but I suspect the problem comes from the use of BiHemiLabel.  
I suspect a bug. In the mean time I recommend you work separately with the  
left and right labels.

pull request welcome as usual.

Alex
