Skip to main content

MNE-BIDS: Organizing MEG, EEG, and iEEG data according to the BIDS specification and facilitating their analysis with MNE-Python

Project description

Gitter Travis Appveyor codecov CircleCi Downloads Latest PyPI release Latest conda-forge release JOSS publication

MNE-BIDS

This is a repository for creating BIDS-compatible datasets with MNE-Python.

BIDS (Brain Imaging Data Structure) is a standard to organize data according to a set of rules that describe:

  • how to name your files

  • where to place your files within a directory structure

  • what additional metadata to store, and how to store it in sidecar json and tsv files

The complete set of rules is written down in the BIDS specification. A BIDS-compatible dataset conforms to these rules and passes the BIDS-validator.

MNE-Python is a software package for analyzing neurophysiology data.

MNE-BIDS links BIDS and MNE with the goal to make your analyses faster to code, more robust to errors, and easily shareable with colleagues.

Documentation

The documentation can be found under the following links:

Dependencies

  • numpy (>=1.14)

  • scipy (>=0.18.1)

  • mne (>=0.19.1)

  • nibabel (>=2.2, optional)

  • pybv (optional)

Installation

We recommend the Anaconda Python distribution. We require that you use Python 3.5 or higher. You may choose to install mne-bids via pip or via conda.

Installation via pip

Besides numpy and scipy (which are included in the standard Anaconda installation), you will need to install the most recent version of MNE using the pip tool:

$ pip install -U mne

Then install mne-bids:

$ pip install -U mne-bids

These pip commands also work if you want to upgrade if a newer version of mne-bids is available. If you do not have administrator privileges on the computer, use the --user flag with pip.

To check if everything worked fine, the following command should not give any error messages:

$ python -c 'import mne_bids'

For full functionality of mne-bids, you will also need to pip install the following packages:

  • nibabel, for interacting with MRI data

  • pybv, to convert EEG data to BrainVision if input format is not valid according to EEG BIDS specifications

If you want to use the latest development version of mne-bids, use the following command:

$ pip install https://api.github.com/repos/mne-tools/mne-bids/zipball/master

Installation via conda

If you have followed the MNE-Python installation instructions, all that’s left to do is to install mne-bids without its dependencies, as they’ve already been installed during the MNE installation process.

Activate the correct conda environment and install mne-bids:

$ conda activate mne
$ conda install --channel conda-forge --no-deps mne-bids

This approach ensures that the installation of mne-bids doesn’t alter any other packages in your existing conda environment.

Alternatively, you may wish to take advantage of the fact that the mne-bids package on conda-forge in fact depends on mne, meaning that a “full” installation of mne-bids (i.e., including its dependencies) will provide you with a working copy of of both mne and mne-bids at once:

$ conda create --name mne --channel conda-forge mne-bids

After activating the environment, you should be ready to use mne-bids:

$ conda activate mne
$ python -c 'import mne_bids'

Quickstart

Currently, we support writing of BIDS datasets for MEG and EEG. Support for iEEG is experimental at the moment.

>>> from mne import io
>>> from mne_bids import write_raw_bids
>>> raw = io.read_raw_fif('my_old_file.fif')
>>> write_raw_bids(raw, 'sub-01_ses-01_run-05', bids_root='./bids_dataset')

Command Line Interface

In addition to import mne_bids, you can use the command line interface. Simply type mne_bids in your command line and press enter, to see the accepted commands. Then type mne_bids <command> --help, where <command> is one of the accepted commands, to get more information about that <command>.

Example:

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

Bug reports

Use the GitHub issue tracker to report bugs.

Contributing

Please see our contributing guide.

Cite

If you use mne-bids in your work, please cite:

Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., Quentin, R., Holdgraf, C.,
Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C.,
Rockhill, A., Larson, E., Gramfort, A. and Jas, M. (2019). MNE-BIDS: Organizing
electrophysiological data into the BIDS format and facilitating their analysis.
Journal of Open Source Software 4: (1896).

and one of the following papers, depending on which modality you used:

MEG

Niso, G., Gorgolewski, K. J., Bock, E., Brooks, T. L., Flandin, G., Gramfort, A.,
Henson, R. N., Jas, M., Litvak, V., Moreau, J., Oostenveld, R., Schoffelen, J.,
Tadel, F., Wexler, J., Baillet, S. (2018). MEG-BIDS, the brain imaging data
structure extended to magnetoencephalography. Scientific Data, 5, 180110.
http://doi.org/10.1038/sdata.2018.110

EEG

Pernet, C. R., Appelhoff, S., Gorgolewski, K. J., Flandin, G.,
Phillips, C., Delorme, A., Oostenveld, R. (2019). EEG-BIDS, an extension
to the brain imaging data structure for electroencephalography. Scientific
Data, 6, 103. https://doi.org/10.1038/s41597-019-0104-8

iEEG

Holdgraf, C., Appelhoff, S., Bickel, S., Bouchard, K., D'Ambrosio, S.,
David, O., … Hermes, D. (2019). iEEG-BIDS, extending the Brain Imaging Data
Structure specification to human intracranial electrophysiology. Scientific
Data, 6, 102. https://doi.org/10.1038/s41597-019-0105-7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mne-bids-0.4.tar.gz (75.1 kB view details)

Uploaded Source

Built Distribution

mne_bids-0.4-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

Details for the file mne-bids-0.4.tar.gz.

File metadata

  • Download URL: mne-bids-0.4.tar.gz
  • Upload date:
  • Size: 75.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for mne-bids-0.4.tar.gz
Algorithm Hash digest
SHA256 a8af1d74172a639519f7f48fc5663f007201b1d8762c44afa09be9c090859cc2
MD5 b0a65944701c43da6b809cadd3ee33bf
BLAKE2b-256 a7a4fd3c13cf560881211a5445882844cf8542d0c0646e82616b6de59e5989f3

See more details on using hashes here.

File details

Details for the file mne_bids-0.4-py3-none-any.whl.

File metadata

  • Download URL: mne_bids-0.4-py3-none-any.whl
  • Upload date:
  • Size: 50.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for mne_bids-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 49b45e1317fb95acbe977d658ee3e75290a9232f69badb7bfb05afe733b6085b
MD5 b0db2dc2e8c7c50bfe59d7adbfa4b1d0
BLAKE2b-256 1ad290c8bf0ed60e6f2363c8596d2ebff114dd40a1b93680904574db06f1ece2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page