mne-tools / mne-tools/mne-python

Channels marked as "bad" have further specification

Open
#10,437 2 comments 1 reaction 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

Hi,

I presented this idea at a previous office hours. I work in a lab that records ieeg data from epilepsy patients. Due to the nature of the data, apart from some channels having a poor signal quality there are some of channels that show interictal activity (sharp spikes that confound just about any analysis), are seizure onset zones, are outside of the brain or surrounded by damaged tissue such as a lesion. My group likes to apply one or more of these tags to channels when they apply as they assist in analyzing and interpreting this data. My initial thought, and that of someone else, was to place this information in an Annotation object like so:

sozChns = ['RDa1','RDa2']
spikeyChns = ['RDa1','RDa2','LDh1']
outChns = ['RDh16','LIp16']
chan_annots = Annotations(
    onset = [0,0,0,0], # Onset and duration indicate that these annotations apply to the entire block and not a section
    duration = [0,0,0,0],
    description = ['soz','interictal','out'],
    ch_names = [ sozChns,spikeyChns,outChns ]
)

We can then aggregate all these channels into the info['bads'] list but it's useful, especially when looking at something like seizure networks, to be able to label channels using these other tags. I've also considered adding this information to _raw_extras dictionary in the Raw object but it wouldn't survive an io round trip. It can be saved in a separative text file (maybe that's how it's done using BIDS) but it's more convenient if it can be saved within the object.

To summarize this long post, it would be nice to be able to apply tags of some kind to channels.

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 the Annotation and Raw representations, including info['bads'] and _raw_extras, and review how BIDS or other I/O paths handle channel metadata. Define the supported channel tags and their persistence requirements, then add coverage showing that tags remain available after an I/O round trip without replacing the existing bad-channel handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.