MNE-BIDS

raw JSON →
0.18.0 verified Fri May 01 auth: no python

MNE-BIDS is a Python package for converting, organizing, and processing MEG, EEG, and iEEG data according to the Brain Imaging Data Structure (BIDS) specification. It integrates with MNE-Python for analysis. Current version: 0.18.0. Released approximately every 3-6 months.

pip install mne-bids
error ModuleNotFoundError: No module named 'mne_bids'
cause Package not installed.
fix
Run pip install mne-bids
error ValueError: The provided BIDS root directory does not exist
cause Root path specified does not exist or is incorrect.
fix
Ensure the root path is a valid directory. Use absolute paths.
error TypeError: read_raw_bids() got an unexpected keyword argument 'bids_path'
cause Using too old version (prior to v0.11) where read_raw_bids accepted positional args.
fix
Update mne-bids to >=0.11.0 and use the keyword argument 'bids_path'.
breaking Version 0.15.0 dropped support for Python 3.8. Upgrade Python to 3.9+.
fix Use Python >=3.9
breaking Version 0.12.0 changed the default behavior of write_raw_bids to overwrite files. Previously it raised an error if a file existed.
fix Set overwrite=False explicitly if you want the old behavior
deprecated Using MNE-BIDS with MNE <1.0 is deprecated. MNE-BIDS 0.12+ requires MNE >=1.0.
fix Upgrade MNE to >=1.0
gotcha BIDSPath does not automatically infer the root directory. If root is not set, write_raw_bids may default to current working directory.
fix Always specify the root parameter explicitly.

Minimal example: define a BIDS path and read raw data.

from mne_bids import BIDSPath, read_raw_bids
bids_path = BIDSPath(subject='01', session='01', task='audiovisual', root='/path/to/bids')
raw = read_raw_bids(bids_path=bids_path)
print(raw)  # prints info about the raw data