mne_bids.mark_channels#
- mne_bids.mark_channels(bids_path, *, ch_names, status, descriptions=None, verbose=None)[source]#
- Update status and description of channels in an existing BIDS dataset. - Parameters:
- bids_pathBIDSPath
- 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.
- ch_namesstr|listofstr
- 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’ | listofstr
- 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 - ch_names.
- descriptionsNone|str|listofstr
- Descriptions of the reasons that lead to the exclusion of the channel(s). If a list, it must match the length of - ch_names. If- None, no descriptions are added.
- verbosebool|str|int|None
- Control verbosity of the logging output. If - None, use the default verbosity level. See the logging documentation and- mne.verbose()for details. Should only be passed as a keyword argument.
 
- bids_path
 - Examples - 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) 
Examples using mne_bids.mark_channels#
 
03. Interactive data inspection and bad channel selection