BrainVision event parser doesn't handle my data correctly
See original GitHub issueThe event parser for BrainVision files generates seemingly arbitrary event codes for my data. This is a problem that was first mentioned in #6267 and supposedly fixed. However, the fix introduced special handling depending on the detected event type:
In the vmrk
files generated in our lab using PyCorder, all stimulus and response events are simply labeled as Event
(i.e., not Stimulus
or Response
, respectively). Therefore, they get assigned IDs 10001+
, and the IDs we assigned to them during recording are basically ignored, yielding the issue(s) brought up in #6267.
When I change the line
_BV_EVENT_IO_OFFSETS = {'Stimulus/S': 0, 'Response/R': 1000, 'Optic/O': 2000}
to include Event
markers:
_BV_EVENT_IO_OFFSETS = {'Stimulus/S': 0, 'Event/': 0, 'Response/R': 1000, 'Optic/O': 2000}
all works as expected and I can do
data = mne.io.read_raw_brainvision('data.vhdr')
events, _ = mne.events_from_annotations(data)
event_id = {'fixation': 100,
'stim_a': 110,
'stim_b': 120,
'stim_c': 160,
'response': 230}
epochs = mne.Epochs(data, events=events, event_id=event_id)
as would be expected.
This was tested with master
.
x-ref https://github.com/cbrnr/mnelab/pull/50 cc @ArndalAndersen
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
Maybe just modify an existing
vhdr
file to haveEvent/
rather thanStimulus/
, that way you don’t even need to add a new file (or even a new test, since it should show up the same way)yes