Skip to content

pop_biosig: a channel list that leaves out Status loses the BDF events #747

Done

Description

@arnodelorme

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.

Part of #735

Activity

  1. added
    bug
    on Nov 27, 2026
  2. claude commented on Nov 27, 2026

    @claude
    Contributor

    🤖 Plan:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions