Skip to content

ENH: Add initial BCI2000 .dat reader (preload-only)#13699

Open
HansujaB wants to merge 8 commits intomne-tools:mainfrom
HansujaB:add-bci2000-reader
Open

ENH: Add initial BCI2000 .dat reader (preload-only)#13699
HansujaB wants to merge 8 commits intomne-tools:mainfrom
HansujaB:add-bci2000-reader

Conversation

@HansujaB
Copy link

Reference issue (if any)

Fixes #13151

What does this implement/fix?

This PR adds basic support for reading BCI2000 .dat files via:

mne.io.read_raw_bci2k()

The implementation:

  • Parses minimal required header fields
  • Decodes signal and state vector
  • Maps StimulusCode to STI 014 stim channel
  • Returns a Raw object using RawArray
  • Includes deterministic unit tests with a synthetic demo file

Tests

  • Synthetic .dat generator included in tests

  • Verifies:

    • sampling rate
    • number of samples
    • stim channel creation
    • correct StimulusCode decoding
    • preload=False raises

Scope (Intentional Limitations)

  • preload=False is not supported (raises NotImplementedError)
  • Minimal header parsing (SamplingRate + State Vector Definition only)
  • Generic channel names (EEG1, EEG2, …)
  • No gain/scaling applied
  • Not added to _get_supported() (since .dat is already mapped to Curry)

The goal is to provide a correct, minimal reader that can be safely extended in follow-up PRs.

@HansujaB HansujaB requested a review from larsoner as a code owner February 27, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BCI2000 .dat file reader

1 participant