ENH: read EGI MFF channelStatus into raw.info["bads"] - #14156
Open
PragnyaKhandelwal wants to merge 2 commits into
Open
ENH: read EGI MFF channelStatus into raw.info["bads"]#14156PragnyaKhandelwal wants to merge 2 commits into
channelStatus into raw.info["bads"]#14156PragnyaKhandelwal wants to merge 2 commits into
Conversation
When categories.xml is present in an MFF directory, collect the union of all channels marked exclusion="badChannels" across every category segment and populate raw.info["bads"] with their MNE channel names.
PragnyaKhandelwal
marked this pull request as ready for review
August 13, 2026 20:16
PragnyaKhandelwal
requested review from
agramfort,
drammock and
larsoner
as code owners
August 13, 2026 20:16
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue (if any)
Part of #13926 (GSoC 2026 meta-issue, Phase 1).
What does this implement/fix?
EGI NetStation marks bad channels per recording epoch inside
categories.xmlusing<channelStatus>elements withexclusion="badChannels". Previously,read_raw_egiignored this file entirely and always returnedraw.info["bads"] == [].This PR adds a helper
_read_channel_status_badsthat:categories.xmlexists in the MFF directory (gracefully skips if absent or unparseable)CategoriesXML class to iterate over every category and segmentexclusion="badChannels"across all segments (both EEGsignalBin=1and PNSsignalBin=2)raw.info["bads"]A test is added that copies an existing test MFF file to a temp directory, injects a minimal
categories.xmlwith two EEG channels marked bad, reads the file, and asserts the bads list is set correctly.Additional information
categories.xmlis absent in most of the existing test MFF files (it is only present intest_egi_evoked.mff, which is an averaged file handled byread_evokeds_mff). The new test therefore constructs a minimalcategories.xmlin a temp copy of the paused multi-epoch test file to exercise the raw reader path.All 26 EGI tests pass.