- mne_bids.mark_channels(bids_path, *, ch_names, status, descriptions=None, verbose=None)#
Update status and description of channels in an existing BIDS dataset.
The recording to update. The
mne_bids.BIDSPathinstance passed here must have the
.rootattribute set. The
.datatypeattribute may be set. If
.datatypeis not set and only one data type (e.g., only EEG or MEG data) is present in the dataset, it will be selected automatically.
The names of the channel(s) to mark with a
statusand possibly a
description. Can be an empty list to indicate all channel names.
- status‘good’ | ‘bad’ |
The status of the channels (‘good’, or ‘bad’). Default is ‘bad’. If it is a list, then must be a list of ‘good’, or ‘bad’ that has the same length as
Descriptions of the reasons that lead to the exclusion of the channel(s). If a list, it must match the length of
None, no descriptions are added.
Mark a single channel as bad.
>>> root = Path('./mne_bids/tests/data/tiny_bids').absolute() >>> bids_path = BIDSPath(subject='01', task='rest', session='eeg', ... datatype='eeg', root=root) >>> mark_channels(bids_path=bids_path, ch_names='C4', status='bad', ... verbose=False)
Mark multiple channels as bad, and add a description as to why.
>>> bads = ['C3', 'PO10'] >>> descriptions = ['very noisy', 'continuously flat'] >>> mark_channels(bids_path, ch_names=bads, status='bad', ... descriptions=descriptions, verbose=False)
Mark all channels with a new description, while keeping them as a “good” channel.
>>> descriptions = ['resected', 'resected'] >>> mark_channels(bids_path=bids_path, ch_names=['C3', 'C4'], ... descriptions=descriptions, status='good', ... verbose=False)