mne_bids.read_raw_bids#
- mne_bids.read_raw_bids(bids_path, extra_params=None, *, return_event_dict=False, verbose=None)[source]#
Read BIDS compatible data.
Will attempt to read associated events.tsv and channels.tsv files to populate the returned raw object with raw.annotations and raw.info[‘bads’].
- Parameters:
- bids_path
BIDSPath The file to read. 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.Note
If
bids_pathpoints to a symbolic link of a.fiffile without asplitentity, the link will be resolved before reading.- extra_params
None|dict Extra parameters to be passed to MNE read_raw_* functions. Note that the
excludeparameter, which is supported by some MNE-Python readers, is not supported; instead, you need to subset your channels after reading.- return_event_dict
bool Whether to return a dictionary that maps annotation descriptions to integer event IDs, in addition to the
Rawobject. If avaluecolumn is present in the*_events.tsvfile, it will be used as the source of the integer event ID values (events withvalue="n/a"will be omitted).- verbose
bool|str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- bids_path
- Returns:
- raw
mne.io.Raw The data as MNE-Python Raw object.
- event_id
dict A mapping from event descriptions to integer event IDs, suitable for, e.g., passing to
mne.events_from_annotations(). Only returned ifreturn_event_dict=True.
- raw
- Raises:
RuntimeErrorIf multiple recording data types are present in the dataset, but
datatype=None.RuntimeErrorIf more than one data files exist for the specified recording.
RuntimeErrorIf no data file in a supported format can be located.
ValueErrorIf the specified
datatypecannot be found in the dataset.
Examples using mne_bids.read_raw_bids#
Interactive data inspection and bad channel selection