Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2022 Aug 19.
Published in final edited form as: J Open Source Softw. 2019 Dec 18;4(44):1896. doi: 10.21105/joss.01896

MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis

Stefan Appelhoff 1, Matthew Sanderson 2, Teon L Brooks 3, Marijn van Vliet 4, Romain Quentin 5, Chris Holdgraf 6, Maximilien Chaumon 7, Ezequiel Mikulan 8, Kambiz Tavabi 9, Richard Höchenberger 10, Dominik Welke 11, Clemens Brunner 12, Alexander P Rockhill 13, Eric Larson 9, Alexandre Gramfort 14, Mainak Jas 15
PMCID: PMC9390980  NIHMSID: NIHMS1780640  PMID: 35990374

Summary

The development of the Brain Imaging Data Structure (BIDS; Gorgolewski et al., 2016) gave the neuroscientific community a standard to organize and share data. BIDS prescribes file naming conventions and a folder structure to store data in a set of already existing file formats. Next to rules about organization of the data itself, BIDS provides standardized templates to store associated metadata in the form of Javascript Object Notation (JSON) and tab separated value (TSV) files. It thus facilitates data sharing, eases metadata querying, and enables automatic data analysis pipelines. BIDS is a rich system to curate, aggregate, and annotate neuroimaging databases.


While BIDS was originally intended for magnetic resonance imaging (MRI) data, it has extensions for other data modalities including: magnetoencephalography (MEG; Niso et al., 2018), electroencephalography (EEG; Pernet et al., 2019), and intracranial encephalography (iEEG; Holdgraf et al., 2019). Software packages analyzing MEG, EEG, and iEEG are now starting to support data organized using the BIDS standard, thereby becoming “BIDS compatible”. Within the Python ecosystem, MNE–Python (Gramfort et al., 2013) is a major software package for electrophysiology data analysis, and extending its functionality to support BIDS would be a great benefit for its growing user base. For this reason, we developed a dedicated Python software package MNE–BIDS with the goal of providing a programmable interface for BIDS datasets in electrophysiology with MNE-Python. MNE–BIDS allows users to re-organize data into BIDS formats, store associated metadata after anonymization, extract information necessary for preprocessing, and read the data into MNE–Python objects, ready for source localization.

Starting with a single directory full of data files with arbitrary names, MNE–BIDS can be used to extract existing metadata, reorganize the files into the BIDS format, and write additional metadata. All the conversion routines are thoroughly tested by running the output through the BIDS validator. Moreover, MNE–BIDS supports converting data formats that are not BIDS compatible into permissible formats. These utilities allow users to easily convert their datasets to BIDS in a matter of minutes, rather than hours of manual labour.

In addition to this core functionality, MNE–BIDS is continuously being extended to facilitate the analysis of BIDS formatted data. Some features include: reading a BIDS dataset as a set of Python objects for analysis with MNE–Python, defacing T1-weighted anatomical MRI images to anonymize data and facilitate sharing, and saving anatomical landmark coordinates to enable coregistration between the MEG/EEG and MRI data, which is necessary for computation of forward and inverse solutions.

Users can easily install MNE–BIDS on all major platforms via pip and conda, and its functionality is continuously tested on Windows, macOS, and Linux. Other than the core dependencies for scientific computing (numpy, scipy) and handling of MEG/EEG data (mne), MNE–BIDS has minimal dependencies, all of which are optional. The Application Programming Interface (API) of the package is stable and extensively documented and explained in examples (https://mne.tools/mne-bids/). In addition, a command-line interface is provided that allows non-Python users to benefit from the core functionality.

As of writing, MNE–BIDS has received code contributions from 15 contributors and its user base is steadily growing. Code development is active and the developer team is committed to provide timely support for issues opened on the GitHub issue tracker.

MNE–BIDS is used as a dependency in several other software packages such as the MNE-study-template, an automated pipeline for group analysis with MNE (Jas et al., 2018), and Biscuit, a graphical user interface to format BIDS data. Lastly, several large institutions have adopted MNE–BIDS for their workflows such as the Martinos Center for Biomedical Imaging.

The developer team is excited to improve the state of the art in data handling and looking forward to welcoming new contributors and users.

Acknowledgements

MNE–BIDS development is partly supported by the Academy of Finland (grant 310988), NIH NINDS R01-NS104585, ERC Starting Grant SLAB ERC-YStG-676943, ANR meegBIDS.fr, BRAIN Initiative and National Institute of Mental Health (1R24MH114705), the Bezos Family Foundation, the Simms Mann Foundation, and the Google Summer of Code 2019.

References

  1. Gorgolewski KJ, Auer T, Calhoun VD, Craddock RC, Das S, Duff EP, Flandin G, et al. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific Data, 3, 160044. doi: 10.1038/sdata.2016.44 [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Gramfort A, Luessi M, Larson E, Engemann DA, Strohmeier D, Brodbeck C, Goj R, et al. (2013). MEG and eeg data analysis with mne-python. Frontiers in Neuroscience, 7, 267. doi: 10.3389/fnins.2013.00267 [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Holdgraf C, Appelhoff S, Bickel S, Bouchard K, D’Ambrosio S, David O, Devinsky O, et al. (2019). IEEG-bids, extending the brain imaging data structure to human intracranial electrophysiology. Scientific Data, 6, 102. doi: 10.1038/s41597-019-0105-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Jas M, Larson E, Engemann DA, Leppäkangas J, Taulu S, Hämäläinen M, & Gramfort A (2018). A reproducible meg/eeg group study with the mne software: Recommendations, quality assessments, and good practices. Frontiers in Neuroscience, 12, 530. doi: 10.3389/fnins.2018.00530 [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Niso G, Gorgolewski KJ, Bock E, Brooks TL, Flandin G, Gramfort A, Henson RN, et al. (2018). MEG-bids, the brain imaging data structure extended to magnetoencephalography. Scientific Data, 5, 180110. doi: 10.1038/sdata.2018.110 [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Pernet CR, Appelhoff S, Gorgolewski KJ, 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. doi: 10.1038/s41597-019-0104-8 [DOI] [PMC free article] [PubMed] [Google Scholar]

RESOURCES