Using MNE-BIDS#

Quickstart#

Python#

>>> import mne
>>> from mne_bids import BIDSPath, write_raw_bids
>>> raw = mne.io.read_raw_fif('my_old_file.fif')
>>> bids_path = BIDSPath(subject='01', session='01', run='05',
                         datatype='meg', root='./bids_dataset')
>>> write_raw_bids(raw, bids_path=bids_path)

Command Line Interface#

Simply type mne_bids in your command line and press enter to see a list of accepted commands. Then type mne_bids <command> --help, where <command> is one of the accepted commands, to get more information about it.

Example:

$ mne_bids raw_to_bids --subject_id sub01 --task rest --raw data.edf --bids_root new_path

Mastering BIDSPath#

To be able to effectively use MNE-BIDS, you need to understand how to work with the BIDSPath object. Follow our basic example on how to read a BIDS dataset, and have a look at this introduction to learn everything you need!

Examples#

The following examples demonstrate some common use-cases of MNE-BIDS.

The examples are loosely ordered from basic to more advanced use cases.

Read BIDS datasets

Read BIDS datasets

Convert MNE sample data to BIDS format

Convert MNE sample data to BIDS format

Interactive data inspection and bad channel selection

Interactive data inspection and bad channel selection

Convert EEG data to BIDS format

Convert EEG data to BIDS format

BIDS conversion for group studies

BIDS conversion for group studies

Rename BrainVision EEG data files

Rename BrainVision EEG data files

Save and load T1-weighted MRI scan along with anatomical landmarks in BIDS

Save and load T1-weighted MRI scan along with anatomical landmarks in BIDS

Convert iEEG data to BIDS format

Convert iEEG data to BIDS format

Convert NIRS data to BIDS format

Convert NIRS data to BIDS format

Manually storing empty room data

Manually storing empty room data

An introduction to BIDSPath

An introduction to BIDSPath

Creating BIDS-compatible folder names and filenames

Creating BIDS-compatible folder names and filenames

Updating BIDS datasets

Updating BIDS datasets

Anonymizing a BIDS dataset

Anonymizing a BIDS dataset

Gallery generated by Sphinx-Gallery