BioSemi Trigger IDs in MNE

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>*

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>*

Thanks,
Neelesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180628/4d87c2aa/attachment.html

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