You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pop_biosig: a channel list that leaves out Status loses the BDF events #747
pop_biosig('test.bdf', 'channels', [1 2 3]) returns no event in EEGPrep. EEGLAB returns the 41 events of the file with the same call.
Cause: EEGPrep looks for the Status channel among the loaded channels. When the channel list leaves it out, the triggers are not read.
Fix: read the triggers from the file whatever the channel list, as EEGLAB does. A few lines in pop_biosig.py, with a test on test.bdf.
Arno (November 26, 2026): "Yes, make sure EEGPrep is doing the same as EEGLAB."
What EEGLAB does on the same file (EEGLAB develop, BIOSIG 3.8.4, jamming)
Call on test.bdf
EEGLAB
EEGPrep before
no option
16 channels, 41 events
16 channels, 41 events
'channels', [1 2 3]
16 channels, no labels, 41 events
3 channels, 0 event
'channels', [1 2 3], 'importevent', 'off'
16 channels, no labels, 0 event
3 channels, 0 event
EEGLAB keeps the events, which is what this issue matches. EEGLAB does not apply the channel list to the data (it returns all 16 channels and loses the labels), and on test.edf the same call stops with an error in biosig2eeglab line 215. That looks like an EEGLAB bug and is not copied: EEGPrep keeps returning the three channels asked for.
CI (lint, docs, macOS, EEGLAB Python backend pass; remaining jobs running)
Research
_import_bdf_status_channel returns early unless Status is among the loaded labels, so a channels list that omits it skips trigger decoding. _blockrange_status_events already reads Status straight from the file via openbdf/readbdf, so it does not need the loaded channel.
Relevant code
src/eegprep/functions/popfunc/pop_biosig.py_import_bdf_status_channel - early return on loaded labels
src/eegprep/functions/popfunc/pop_biosig.py_blockrange_status_events - reads Status from the file
Proposed Fix
Gate event import on Status being in the file header; gate channel removal on Status being in the loaded labels.
PR #748 changes core pop_biosig code, so it needs the MATLAB EEGLAB reference run and human approval before merge.
Activity
claude commentedon Nov 27, 2026
🤖 Plan:
tests/test_bdf_records_eeglab_tests.py_import_bdf_status_channelResearch
_import_bdf_status_channelreturns early unlessStatusis among the loaded labels, so achannelslist that omits it skips trigger decoding._blockrange_status_eventsalready readsStatusstraight from the file viaopenbdf/readbdf, so it does not need the loaded channel.Relevant code
src/eegprep/functions/popfunc/pop_biosig.py_import_bdf_status_channel- early return on loaded labelssrc/eegprep/functions/popfunc/pop_biosig.py_blockrange_status_events- reads Status from the fileProposed Fix
Gate event import on
Statusbeing in the file header; gate channel removal onStatusbeing in the loaded labels.PR #748 changes core
pop_biosigcode, so it needs the MATLAB EEGLAB reference run and human approval before merge.docs: changelog entry for #747, wrap lines
[IO] Read BDF Status triggers when pop_biosig channels omit Status (#748