# MNEpy stc to label

**URL:** <https://mne.discourse.group/t/mnepy-stc-to-label/707>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 8, 2014, 7:10pm UTC](https://mne.discourse.group/t/mnepy-stc-to-label/707 "2014-04-08T19:10:29Z")\
**Posts on this page:** 2\
**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:** [April 8, 2014, 7:10pm UTC](https://mne.discourse.group/t/mnepy-stc-to-label/707/1 "2014-04-08T19:10:29Z")

</div>

Hi all,  
I am trying to use `mne.stc_to_label` to generate the freesurfer label for  
connected non-zero vertices. When I pass the `connected=True` argument I  
receive an index error i.e., "index 4098 is out of bounds for axis 0 with  
size 4098" at ln 667 of label.py. I am using an oct-6 surface source space  
with c. 10000 vertices of which 4098 are in use.

However, when I pass `connected=False` the list of labels is returned. Can  
someone tell me why this occurs? and how to get the list of connected  
labels?

regards,  
Kam

---

<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:** [April 9, 2014, 6:29am UTC](https://mne.discourse.group/t/mnepy-stc-to-label/707/2 "2014-04-09T06:29:33Z")

</div>

hi Kam,

can you reproduce this on the sample dataset?

if not can you share a minimum set of files to reproduce the problem?

Alex
