mne-tools / mne-tools/mne-python

.get_data() reject_by_annotation does not consider ch_names in annotations

Open
#10,914 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

The .get_data() method in the mne.io.BaseRaw supports an argument called reject_by_annotation and the "bad" annotations can be either omitted or changed to nan. But as recently, a new feature was added to the mne.Annotations object to be able to add the ch_names for the annotations. The problem is that when the ch_names are set in the annotations, the reject_by_channel argument still omits or changes "all" the values to NaN.

I think there should be an option to only transform those ch_names present in the annotations to NaN instead of all values.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading mne.io.BaseRaw.get_data() and the mne.Annotations support for channel-specific annotations. Reproduce the behavior with reject_by_annotation when ch_names are set, then verify that only the annotated channels are omitted or changed to NaN while other channels remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.