Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/devel/13280.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed bug where :func:`mne.preprocessing.maxwell_filter_prepare_emptyroom` would not reliably identify meg channel types for matching bads across emptyroom and task, by `Harrison Ritz`_.
7 changes: 6 additions & 1 deletion mne/preprocessing/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ def maxwell_filter_prepare_emptyroom(
elif bads == "keep":
bads = raw_er_prepared.info["bads"]

bads = [ch_name for ch_name in bads if ch_name.startswith("MEG")]
# Filter to only include MEG channels
meg_ch_names = [
raw_er_prepared.ch_names[pick]
for pick in pick_types(raw_er_prepared.info, meg=True, exclude=[])
]
bads = [ch_name for ch_name in bads if ch_name in meg_ch_names]
raw_er_prepared.info["bads"] = bads

# handle dev_head_t
Expand Down
Loading