# BioSemi Trigger IDs in MNE

**URL:** <https://mne.discourse.group/t/biosemi-trigger-ids-in-mne/1559>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 28, 2018, 6:45pm UTC](https://mne.discourse.group/t/biosemi-trigger-ids-in-mne/1559 "2018-06-28T18:45:39Z")\
**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:** [June 28, 2018, 6:45pm UTC](https://mne.discourse.group/t/biosemi-trigger-ids-in-mne/1559/1 "2018-06-28T18:45:39Z")

</div>

External Email - Use Caution

Hi,

I am trying to send trigger from a linux system to the Biosemi ActiveOne  
system using NI USB-6501 encased in Biosemi TCPUA. Since there is no  
National Instrument driver for the linux distro that I have, I am using the  
following third party driver to send 8 bit triggers:

\*[https://github.com/orlof/NI\_USB-6501](https://github.com/orlof/NI_USB-6501)  
\<[https://github.com/orlof/NI\_USB-6501](https://github.com/orlof/NI_USB-6501)\>\*

like so:

dev.write\_port(0, 0b00000001)

The trigger ID received in EMSE editor is the decimal equivalent of the  
binary string sent above- R1, R3, ... (which is what I want). However when  
I try to read the triggers using MNE, the trigger IDs are different and  
incomprehensible.

Example:

import mne  
raw = mne.io.read\_raw\_edf('test\_run2.bdf')  
raw\_events = mne.find\_events(raw, stim\_channel='Status')  
print(raw\_events[:3])

results in the following output:

Extracting edf Parameters from test\_run2.bdf...  
BDF file detected  
Setting channel info structure...  
Created Raw.info structure...  
Ready.  
[[144 7797761 7863297]  
[9199 7860737 7862273]  
[13558 7859713 7860737]  
[21770 7860225 7863297]

The values in the third column are the trigger IDs: 7863297, 7862273, ...

Also, the number of events detected are less than what they should be (44  
as compared to around 60).

Can anyone help me with this? Following is the google drive link of the bdf  
file, if it helps:

\*[https://drive.google.com/file/d/1eXKZ3YQIp-FH\_WP4rVi954iQvhGJ5L8m/view?usp=sharing](https://drive.google.com/file/d/1eXKZ3YQIp-FH_WP4rVi954iQvhGJ5L8m/view?usp=sharing)  
\<[https://drive.google.com/file/d/1eXKZ3YQIp-FH\_WP4rVi954iQvhGJ5L8m/view?usp=sharing](https://drive.google.com/file/d/1eXKZ3YQIp-FH_WP4rVi954iQvhGJ5L8m/view?usp=sharing)\>\*

Thanks,  
Neelesh  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180628/4d87c2aa/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180628/4d87c2aa/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:** [June 29, 2018, 5:36am UTC](https://mne.discourse.group/t/biosemi-trigger-ids-in-mne/1559/2 "2018-06-29T05:36:37Z")

</div>

External Email - Use Caution

Hi!

Try setting the arguments consecutive, shortest\_events, and min\_duration to different values. I get 61 events with this call:

events = mne.find\_events(raw, consecutive=True, shortest\_event=0, min\_duration=1)

You can also plot the stim channel to get an idea how to best extract events. To this end, you need to set preload=True when loading the data, and then you can use Matplotlib as follows:

plt.plot(raw.\_data[-1])

HTH,  
Clemens
