mne_bids.inspect_dataset¶
-
mne_bids.
inspect_dataset
(bids_path, find_flat=True, l_freq=None, h_freq=None, show_annotations=True, verbose=None)[source]¶ 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.
Warning
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.
Note
Currently, only MEG, EEG, and iEEG data can be inspected.
To add or modify annotations, press
A
to toggle annotation mode.- Parameters
- bids_path
mne_bids.BIDSPath
A
mne_bids.BIDSPath
containing at least aroot
. All matching files will be inspected. To select only a subset of the data, set moremne_bids.BIDSPath
attributes. Ifdatatype
is 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 themne_bids.BIDSPath
attributes required to uniquely identify the file: If thisBIDSPath
is accepted bymne_bids.read_raw_bids()
, it will work here.- find_flatbool
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% of flat data will be marked asbad
in*_channels.tsv
.Note
This function calls
mne.preprocessing.annotate_flat()
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% 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*_events.tsv
.- l_freq
float
|None
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.- h_freq
float
|None
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.- show_annotationsbool
Whether to show annotations (events, bad segments, …) or not. If
False
, toggling annotations mode by pressingA
will be disabled as well.- verbosebool |
None
If a boolean, whether or not to produce verbose output. If
None
, use the default log level.
- bids_path
Examples
Disable flat channel & segment detection, and apply a filter with a passband of 1–30 Hz.
>>> inspect_dataset(bids_path=bids_path, find_flat=False, l_freq=1, h_freq=30)