question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Brainvision stim channel creation fails if event durations are 0

See original GitHub issue

Stim channels for brainvision and EEGLAB files are created like this:

    for onset, duration, trigger in events:
        stim_channel[onset:onset + duration] = trigger

If the duration is 0, which it often is, this will result in no events being recorded.

I am not sure how to deal with this.

The events are still available to the user at raw._events, but mne.find_events etc won’t work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jona-sassenhagencommented, May 30, 2018

BV vmrk files have a duration column that is set to 0 for the file I’m looking at … but yeah, we can, i.e., change

    for onset, duration, trigger in events:
        stim_channel[onset:onset + duration] = trigger

to

    for onset, duration, trigger in events:
        stim_channel[onset:onset + (duration if duration > 0 else 1)] = trigger

and add a test.

(Thinking of Cornelius here 😃)

1reaction
larsonercommented, May 30, 2018

we should probably make the min duration 1 sample

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brain Vision Recorder | User Manual - TSG Doc
It makes sense to display the ECG channels with reduced scaling, since otherwise they encroach significantly on the curves of the EEG channels....
Read more >
mne.io.Raw — MNE 1.2.2 documentation - MNE-Python
If True the old events on the stim channel are removed before adding the new ... a corresponding channel is added and its...
Read more >
Operating Instructions | BrainVision Recorder
rights reserved in the event of the grant of a patent, ... The number of channels is restricted only by the amplifier that...
Read more >
Frequently Asked Questions - Brain Vision
Use the search function below to find answers to commonly asked questions or browse the FAQs by clicking on a category. We are...
Read more >
web.mit.edu/kolya/.f/root/net.mit.edu/athena.mit.e...
This event filtering is especially usefull for real-time % processing. ... fid=fopen(filename,'rt'); if fid==-1, error('cannot open BrainVision marker ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found