Skip to content

pop_biosig and pop_fileio: EDF channel labels keep the prefix EEG (EEGLAB removes it) #746

Done

Description

@arnodelorme

On the same EDF file, EEGLAB returns the labels Fp1, Fp2, ... and EEGPrep returns EEG Fp1, EEG Fp2, ... (finding F5 of the File menu report). The channel location lookup can then fail in EEGPrep.

  • Cause: EEGLAB removes the prefix in eeg_checkchanlocs.m (line 220), which every import runs. EEGPrep has the same rule in eeg_checkchanlocs.py but the MNE readers of pop_fileio (EDF, BDF, GDF, EGI) never call it.
  • Fix: call it after an MNE read. A few lines, with a test on test.edf, the file EEGLAB was run on.
  • Arno (November 26, 2026): "Yes, fix. When you do the issue and the pull request, make it simple though. And minimal code changes."
EEGLAB's rule

When a label contains EEG and fewer than 30 labels are a number once EEG is removed (so EEG001 to EEG064 are left alone), the strings EEG-, EEG and EEG are removed from every label.

Part of #735

Activity

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

    @claude
    Contributor

    🤖 Plan:

    • Failing test: EDF with EEG Fp1/EEG-Fp2 labels imported via pop_fileio and pop_biosig returns Fp1, Fp2 (tests/test_stream9_readers.py)
    • Fix: mne_raw_to_eeg (src/eegprep/functions/popfunc/_file_io.py) runs eeg_checkchanlocs on the channel list, covering EDF/BDF/GDF (pop_biosig goes through pop_fileio) and pop_mffimport
    • pre-commit + importer tests pass locally; user guide note added
    • PR [IO] Strip EEG channel label prefix on EDF/BDF/GDF import #749
    • CI green
    • EEGLAB reference run (core import path change, needs human approval)

    Research: _clean_labels in src/eegprep/functions/adminfunc/eeg_checkchanlocs.py#L194-L211 ports EEGLAB eeg_checkchanlocs.m L220, but mne_raw_to_eeg built chanlocs from raw.ch_names without calling it.

  3. added a commit that references this issue on Nov 27, 2026
  4. added a commit that references this issue on Nov 28, 2026
    15e0771
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