Skip to content

Fix SourceChGain/SourceChOffset handling in BCI2k reader#13869

Open
HansujaB wants to merge 2 commits intomne-tools:mainfrom
HansujaB:SourceChGain-and-SourceChOffset
Open

Fix SourceChGain/SourceChOffset handling in BCI2k reader#13869
HansujaB wants to merge 2 commits intomne-tools:mainfrom
HansujaB:SourceChGain-and-SourceChOffset

Conversation

@HansujaB
Copy link
Copy Markdown
Contributor

@HansujaB HansujaB commented Apr 26, 2026

Reference issue

Fixes #13851

What does this implement/fix?

  • Parse BCI2000 *list parameters correctly by treating the first token as list length.
  • Parse numeric values with embedded units via a fn _parse_value_with_unit
  • I have removed fn _parse_sampling_rate and used the above fn for that as well
  • Apply SourceChOffset and SourceChGain calibration per channel so EEG data is returned in volts.

Tests

  • Updated BCI2k reader tests to check real-file header parsing for:
    • SourceChOffset == ["0", "0"]
    • SourceChGain == ["0.1muV", "0.1muV"]
  • Wrote a unit test for unit parsing checks for voltage and frequency suffixes.

Questions

  • Do we want the unit parser test (test_parse_value_with_unit) ?
  • Do we also want a test to check scaling is right?
  • Should I edit examples/io/read_bci2k.py as well?

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.

SourceChGain and SourceChOffset not applied - BCI2k reader

1 participant