- mne_bids.inspect_dataset(bids_path, find_flat=True, l_freq=None, h_freq=None, show_annotations=True, verbose=None)#
Inspect and annotate BIDS raw data.
This function allows you to browse MEG, EEG, and iEEG raw data stored in a BIDS dataset. You can toggle the status of a channel (bad or good) by clicking on the traces, and when closing the browse window, you will be asked whether you want to save the changes to the existing BIDS dataset or discard them.
This functionality is still experimental and will be extended in the future. Its API will likely change. Planned features include automated bad channel detection and visualization of MRI images.
Currently, only MEG, EEG, and iEEG data can be inspected.
To add or modify annotations, press
Ato toggle annotation mode.
mne_bids.BIDSPathcontaining at least a
root. All matching files will be inspected. To select only a subset of the data, set more
datatypeis not set and multiple datatypes are found, they will be inspected in the following order: MEG, EEG, iEEG. To read a specific file, set all the
mne_bids.BIDSPathattributes required to uniquely identify the file: If this
BIDSPathis accepted by
mne_bids.read_raw_bids(), it will work here.
Whether to auto-detect channels producing “flat” signals, i.e., with unusually low variability. Flat segments will be added to
*_events.tsv, while channels with more than 5 percent of flat data will be marked as
This function calls
mne.preprocessing.annotate_amplitude(MNE-Python 1.0 or newer) or
mne.preprocessing.annotate_flat(older versions of MNE-Python) and will only consider segments of at least 50 ms consecutive flatness as “flat” (deviating from MNE-Python’s default of 5 ms). If more than 5 percent of a channel’s data has been marked as flat, the entire channel will be added to the list of bad channels. Only flat time segments applying to channels not marked as bad will be added to
The high-pass filter cutoff frequency to apply when displaying the data. This can be useful when inspecting data with slow drifts. If
None, no high-pass filter will be applied.
The low-pass filter cutoff frequency to apply when displaying the data. This can be useful when inspecting data with high-frequency artifacts. If
None, no low-pass filter will be applied.
Whether to show annotations (events, bad segments, …) or not. If
False, toggling annotations mode by pressing
Awill be disabled as well.
Disable flat channel & segment detection, and apply a filter with a passband of 1–30 Hz.
>>> from mne_bids import BIDSPath >>> root = Path('./mne_bids/tests/data/tiny_bids').absolute() >>> bids_path = BIDSPath(subject='01', task='rest', session='eeg', ... suffix='eeg', extension='.vhdr', root=root) >>> inspect_dataset(bids_path=bids_path, find_flat=False, ... l_freq=1, h_freq=30)