# Brainvision events

**URL:** <https://mne.discourse.group/t/brainvision-events/2323>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [September 22, 2020, 2:20pm UTC](https://mne.discourse.group/t/brainvision-events/2323 "2020-09-22T14:20:01Z")\
**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:** [September 22, 2020, 2:20pm UTC](https://mne.discourse.group/t/brainvision-events/2323/1 "2020-09-22T14:20:01Z")

</div>

External Email - Use Caution

Hi,  
I have been struggling to find the events from my files. Here is what I've got so far:  
I am attaching a vhdr file with the markers  
import mne

mne.set\_log\_level('WARNING')  
fname = "go.nogo.01.vhdr"  
raw = mne.io.read\_raw\_brainvision(fname, preload=True)

montage = mne.channels.make\_standard\_montage('standard\_1020')raw.set\_montage(montage, raise\_if\_subset = False)

ica = mne.preprocessing.ICA(n\_components=15, random\_state=97)  
ica.fit(raw.copy().filter(1,40))  
ica.plot\_sources(raw);  
ica.plot\_components()

raw = ica.apply(raw.copy(), exclude = ica.exclude)

raw.plot();

events = mne.events\_from\_annotations(raw, event\_id='auto')  
events;  
tmin, tmax = -0.2, 0.5

events\_nogo\_sed = [88,89,90,91,92,93,94,95,96,97,98,99,100,  
&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;101,102,103,104,105,106,107,108,109,110,  
&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;111,112,113]

epochs = mne.Epochs(raw, events, events\_nogo\_sed, tmin, tmax)

TypeError: events should be a NumPy array of integers, got \<class 'tuple'\>

Daniel Cabral.

PhD student  
Graduate Teaching Assistant  
Performance and Exercise Psychophysiology lab  
School of Kinesiology  
Auburn University  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200922/73ac520e/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/73ac520e/attachment-0001.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: go.nogo.01.vmrk  
Type: application/octet-stream  
Size: 61508 bytes  
Desc: go.nogo.01.vmrk  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200922/73ac520e/attachment-0001.obj](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/73ac520e/attachment-0001.obj)

---

<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:** [September 22, 2020, 2:26pm UTC](https://mne.discourse.group/t/brainvision-events/2323/2 "2020-09-22T14:26:34Z")

</div>

mne.events\_from\_annotations returns a tuple of (events\_array,  
event\_id\_dict).

You need:

events, events\_mapping = mne.events\_from\_annotations(raw, event\_id='auto')

> ???External Email - Use Caution???
> 
> Hi,  
> I have been struggling to find the events from my files. Here is what  
> I've got so far:  
> I am attaching a vhdr file with the markers  
> import mne
> 
> mne.set\_log\_level('WARNING')  
> fname = "go.nogo.01.vhdr"  
> raw = mne.io.read\_raw\_brainvision(fname, preload=True)
> 
> montage =  
> mne.channels.make\_standard\_montage('standard\_1020')raw.set\_montage(montage,  
> raise\_if\_subset = False)
> 
> ica = mne.preprocessing.ICA(n\_components=15, random\_state=97)  
> ica.fit(raw.copy().filter(1,40))  
> ica.plot\_sources(raw);  
> ica.plot\_components()
> 
> raw = ica.apply(raw.copy(), exclude = ica.exclude)
> 
> raw.plot();
> 
> events = mne.events\_from\_annotations(raw, event\_id='auto')  
> events;  
> tmin, tmax = -0.2, 0.5
> 
> events\_nogo\_sed = [88,89,90,91,92,93,94,95,96,97,98,99,100,  
> ? ? ? ? ? ? ? ? ? ? ? ? ? 101,102,103,104,105,106,107,108,109,110,  
> ? ? ? ? ? ? ? ? ? ? ? ? ? 111,112,113]
> 
> epochs = mne.Epochs(raw, events, events\_nogo\_sed, tmin, tmax)
> 
> TypeError: events should be a NumPy array of integers, got \<class 'tuple'\>
> 
> \*Daniel Cabral.\*
> 
> PhD student  
> Graduate Teaching Assistant  
> Performance and Exercise Psychophysiology lab  
> School of Kinesiology  
> Auburn University
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200922/6966fecf/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: signature.asc  
Type: application/pgp-signature  
Size: 488 bytes  
Desc: OpenPGP digital signature  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200922/6966fecf/attachment.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment.bin)  
-------------- next part --------------  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200922/6966fecf/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment-0001.html)
