Comment | Open | Published:

iEEG-BIDS, extending the Brain Imaging Data Structure specification to human intracranial electrophysiology

The Brain Imaging Data Structure (BIDS) is a community-driven specification for organizing neuroscience data and metadata with the aim to make datasets more transparent, reusable, and reproducible. Intracranial electroencephalography (iEEG) data offer a unique combination of high spatial and temporal resolution measurements of the living human brain. To improve internal (re)use and external sharing of these unique data, we present a specification for storing and sharing iEEG data: iEEG-BIDS.

Human intracranial electroencephalography1,2 (iEEG) data are recorded at specialized medical centers with electrodes placed on or implanted in the human brain3,4. Electrodes can be placed during epilepsy monitoring, tumor surgery, or for deep brain stimulation (DBS). During these times, patients can voluntarily participate in scientific experiments5,6,7,8,9. Due to the specialized clinical setting in which iEEG data are recorded, iEEG is relatively rare compared to EEG or MRI, and researchers sometimes have to wait several years before completing a study. This makes it important to have a consistent way of archiving and documenting iEEG data within a lab. In addition, because of its unique spatiotemporal properties5,6,7,8,9 and the high cost of acquisition, it is important that these unique data, contributed by rare patients, are made maximally useful and reusable to the scientific community.

Currently, iEEG datasets are stored in many different structures, with each lab adopting their own methods for data and metadata organization, which imposes a substantial barrier to collaboration, reproducibility, and scientific progress. In addition, there are many electrophysiology file formats, which do not generally include all information needed to understand, analyze, and reproduce scientific results. This includes the electrode position, referencing method prior to digitization, simultaneously recorded physiology data, the timing of task events, details on the presented stimuli, or anatomical imaging data from the same subjects. There is a clear need for a community standard to better describe all aspects of iEEG data and its experimental context.

BIDS comprises a standardized specification for folder and file naming, the choice of data formats, and the representation of metadata. It is a modality-agnostic specification, relying on community-driven processes to extend the original specification (written for MRI) to new modalities. For example, the MEG community has extended BIDS for this type of data2, and the EEG community has recently finished preparing their extension10.

This paper announces the extension of the BIDS specification to raw, unprocessed human iEEG data, spanning stereo EEG (sEEG), electrocorticography (ECoG), and deep brain stimulation (DBS). It describes the global BIDS structure and some highlights of the current iEEG-BIDS specification. Adoption of iEEG-BIDS will minimize the burden of data curation, facilitate multimodal data integration, and make iEEG data more valuable to future researchers working in the specific lab and to the wider scientific community.

iEEG-BIDS Data Structure

The general BIDS specification is designed to modularize data such that it can gracefully handle multiple modalities and recording devices that belong to a single dataset. Metadata are stored either as a Tab Separated Value (TSV) file for tabular data (.tsv) or as JavaScript Object Notation (JSON) file for “key-value” data (.json) (Fig. 1). These file formats have the advantage of being both human and machine-readable. Metadata fields that are not specific to the iEEG extension are shared with the broader BIDS specification. There were several new types of metadata files created for iEEG-BIDS, as well as additions to pre-existing metadata standards in BIDS. These include developing the file content and naming of the metadata for the iEEG data files (_ieeg.json, Fig. 1b), amplifier settings for each channel (_channels.tsv, Fig. 1c), as well as the metallic electrode contacts (_electrodes.tsv) and their coordinate space with a link to a specific reference image (_coordsystem.json) (Fig. 1e). There were several discussed topics that are of particular relevance to the iEEG community, which we briefly cover next.

Fig. 1
figure1

iEEG-BIDS folder structure with pictures of data types. (a) This BIDS structure contains several folders for subjects and one for stimuli. Within a subject folder, an /anat/ folder may contain an MRI of a subject alongside iEEG data. Extending the BIDS specification to iEEG data involved the definition of the files in the /ieeg/ folder including new file types and pieces of metadata. (b) iEEG data are stored in the BrainVision Core Data format alongside information for acquisition systems and their parameters in an _ieeg.json file. (c) Metadata about channel-specific information, such as hardware filters or electrophysiological units are stored in a _channels.tsv file. (d) Events during an iEEG recording. Event timing data is stored in an _events.tsv TSV file (e) Electrode coordinates are stored in an _electrodes.tsv files and the coordinate system is stored in a _coordsystem.json file. If electrode coordinates are in 3D and are intended for a specific anatomical volume images (.nii.gz), this allows automatically making surface renderings with electrodes and displaying labels from different atlases, here shows with probabilistic maps of visual areas17. (f) Other images that are relevant for iEEG, such as surface models and 2-D images can be stored in a systematic manner. Optional folders and labels, such as the session folder and space- label, are mostly left out of this example. For other examples, see the BIDS examples: github.com/bids-standard/bids-examples.

Channels vs. Electrodes

Terms for electrodes (a physical object), and channels (a part of an acquisition system) can potentially overlap, and several definitions were discussed and added as a part of the iEEG-BIDS and EEG-BIDS specifications. Input from members of these communities (as well as those from others such as MEG) resulted in the following definitions for “electrode” and “channel”:

  • Channel: a single analog-digital converter in the recording system that regularly samples the value of a transducer, which results in a signal being represented as a time series in the data. This can be connected to two electrodes (to measure the potential difference between them), a magnetic field or magnetic gradient sensor, temperature sensor, accelerometer, etc.

  • Electrode: a single point of contact between the acquisition system and the recording site (e.g., scalp, neural tissue,…). Multiple electrodes can be organized as caps (for EEG), arrays, grids, leads, strips, probes, shafts, etc.

Electrophysiology Units

As the original BIDS specification dealt primarily with data from an MRI machine, it was also necessary to create standards around the units to be used for electrophysiology data. This was done in partnership with the EEG-BIDS and MEG-BIDS communities. Physical units of any data in a BIDS structure are presented according to their SI unit symbol and possibly prefix symbol (e.g., mV, µV, with the µ as unicode U + 00B5), now specified in the BIDS specification (https://bids-specification.readthedocs.io/en/latest/99-appendices/05-units.html).

Electrode Locations in iEEG-BIDS

A necessary component to interpret iEEG data are the electrode locations on the cortical surface or embedded in brain tissue. Electrode locations are generally obtained by integrating data from a CT, post-operative MRI, X-ray, or operative photo. Electrodes are then identified and sorted according to medical records, such as a sketch made by the neurological or neurosurgical team. There are several semi-automated software packages that allow researchers to do this. The iEEG-BIDS specification requires that any electrode locations are paired with explicit coordinate systems and, where applicable, the path to an image that can be used to visualize the electrodes on a brain. These may be volume files (e.g., .nii.gz), cortical surfaces, or 2-D images of the patient’s brain. To accommodate localization of iEEG electrodes, iEEG-BIDS added several new options for localization metadata in “_electrodes.tsv” and “_coordsystem.json” files. Electrodes can be localized in multiple spaces by specifying multiple JSON files, and the IntendedFor field makes it straightforward to pair electrode position data with its corresponding image. Finally, iEEG-BIDS explicitly allows for electrode positions to be given in 2-dimensional space in the event that anatomical data are only provided in the form of either operative photos or cortical surface photos.

Data Formats for iEEG

A challenge in extending the BIDS format to iEEG data was handling the diversity of data formats. Contrary to the MRI community, there is no single accepted format used across iEEG groups. In choosing the data formats considered to be compliant with iEEG-BIDS, the community attempted to cover as many possible iEEG data use-cases with as few unique formats as possible, and an informal survey was sent to the electrophysiology communities to help determine which formats were most suitable as “first class citizens” in the iEEG-BIDS specification. A description of this process and the results was originally published in a blog post for the Berkeley Institute for Data Science (https://bids.berkeley.edu/news/bids-megeegieeg-data-format-survey).

After reviewing community feedback and discussing with the MEG-BIDS and EEG communities10, the iEEG-BIDS community decided to support two classes of data formats: compliant formats, and unofficially-supported formats (see the blog post).

Compliant formats

There are two compliant data formats for the iEEG-BIDS extensions: European Data Format (https://en.wikipedia.org/wiki/European_Data_Format, .edf files, and BrainVision Core Data Format (.vhdr, .vmrk, and eeg) (https://www.brainproducts.com/productdetails.php?id=21&tab=5). They have been chosen because they jointly cover the majority of use-cases in iEEG while also providing a solution for most major technical challenges in iEEG data. EDF is a prolific format in the iEEG community and offers variable sampling rates per channel. BrainVision is supported by EEG-BIDS, and makes up for some technical shortcomings of EDF (such as being able to store data to a higher level of numerical precision of up to 32 bits). Compliant formats in iEEG-BIDS will continue to be supported in the future, and will have the majority of community effort and development in creating tooling.

Unofficially supported formats

There are three “unofficially-supported” formats. Their use is discouraged, though allowed for reasons stated below. These unofficially-supported formats are: Neurodata Without Borders (.nwb) due to its shared goals in facilitating sharable and reproducible neurophysiology datasets, EEGLab (.set) due to its prevalent use in the iEEG community, and Multiscale Electrophysiology Format version 3 (MEF3) due to its suitability and future potential for clinical iEEG recordings and device-related applications (such as HIPAA-compliant multi-layer encryption of sensitive data). Unofficially-supported formats will pass the validator, but are not guaranteed to become supported in the future, and unofficial support may be dropped.

There is no hard rule about the number of compliant data formats allowed, though the number will be kept as low as possible. Unofficially supported formats may be dropped (if they offer redundant functionality or if their usage drops significantly), or promoted to compliant format status (if they fill a specific niche and meet the guidelines for compliant format status). This process will be carried out by the iEEG-BIDS community in future extension proposals.

Community Software, Datasets, and Adoption

BIDS is a community project with two primary products: a specification for organizing neuroscience data, and a collection of software and tooling that facilitates the use of BIDS data structures. Creating the iEEG-BIDS specification involved the development of several new community tools. Below we list those that required the most new development for iEEG-BIDS.

The BIDS validator

A validator (written in javascript) determines whether a given dataset adheres to the BIDS specification (bids-standard.github.io/bids-validator/). It parses a folder, checks whether its hierarchy and naming structure conform to BIDS, and checks text files for the proper metadata and file types needed for the BIDS specification. The BIDS validator was modified in order to validate the new metadata fields and folder structures introduced by the iEEG-BIDS extension.

Online iEEG datasets organized according to iEEG-BIDS

As a part of creating the iEEG-BIDS specification, five datasets were converted to BIDS format and added to the BIDS-examples github repository (github.com/bids-standard/bids-examples). These examples are meant to demonstrate how the BIDS specification maps onto different scientific use-cases. The neural data of each dataset is removed in order to make it easier to download, though instructions are provided for accessing the full datasets. The datasets available include: an auditory filtered speech experiment, a motor-movement dataset, a visual stimulus dataset, seizure sEEG recordings from a focal epilepsy of the left temporo-occipital junction, and a multimodal dataset with fMRI and ECoG per subject.

The BIDS starter kit

The BIDS starter kit is a collection of community-driven guides, tutorials, helper scripts, and wiki resources to help researchers get started with the BIDS data structure (github.com/bids-standard/bids-starter-kit). These resources cover the two main languages supported by iEEG-BIDS (Matlab and Python). A tutorial that describes how to create a BIDS-compatible iEEG dataset has been provided on the starter-kit wiki (http://github.com/bids-standard/bids-starter-kit/wiki/Creating-a-BIDS-compatible-iEEG-dataset) and Matlab and Python scripts are also available to produce iEEG sidecar .json and .tsv files.

pybv and pyedf

While many neuroscience toolboxes exist for the Matlab language, there are relatively fewer for Python. To improve Python support for the primary data formats supported by iEEG-BIDS, two new python packages were created for writing BrainVision (pybv, github.com/bids-standard/pybv) and European Data Format (github.com/bids-standard/pyedf) files. These will be maintained by the BIDS community.

MNE-BIDS and MNE-Python

The MNE-Python package is an open-source tool for electrophysiology analysis, visualization, and data representation in Python, and has recently been extended to include functionality for iEEG. Alongside the creation of the iEEG-BIDS specification, the community worked alongside those in the EEG and MEG communities to create a new package for moving between MNE-Python and the BIDS specifications in electrophysiology: MNE-BIDS (github.com/mne-tools/mne-bids). MNE-BIDS facilitates converting electrophysiology workflows in MNE-Python into the BIDS dataset framework11.

FieldTrip

FieldTrip is an open toolbox for electrophysiology analytics in the Matlab language12,13. It supports importing data from a large number of iEEG formats and can export data to BIDS recommended formats. Furthermore, FieldTrip includes the data2bids.m function to help users to organize their iEEG and MRI data and to provide proper metadata annotation (www.fieldtriptoolbox.org/example/bids).

iElvis

iELVis (github.com/iELVis/iELVis) is an open source Matlab package for localizing iEEG electrodes and visualizing their data overlaid on neuroimaging14. It can read and write iEEG electrode coordinates and associated neuroimaging files using BIDS-iEEG conventions. See the BIDS-iEEG compatibility page for more information (http://ielvis.pbworks.com/w/page/130759893/BIDS-iEEG%20Compatibility).

Brainstorm

Brainstorm is an open-source Matlab application for the analysis of multimodal neurophysiology data15. It provides user interfaces for positioning electrode contacts in post-implantation CT or T1 scans as well as reviewing/annotating long data records such as clinical iEEG signals (neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity). It supports most file formats commonly used in iEEG and can convert them into BrainVision or EDF files. Studies in Brainstorm’s database can be imported and exported automatically as BIDS-formatted datasets.

OpenNeuro

Open Neuro is a repository for public neuroimaging data, currently supporting MRI and MEG (OpenNeuro.org). It heavily capitalizes on the BIDS standard - each dataset is validated prior to upload using the bids-validator. OpenNeuro now supports, validates, and accepts iEEG-BIDS data. This allows researchers that adopted BIDS in their labs to easily archive and share their iEEG datasets online.

BIDS Extensions

The BIDS specification is an ongoing process with a growing community. It uses the BIDS Extension Proposals (BEP) process to discuss and integrate improvements in the BIDS specification. Several outstanding questions will require further community input and discussion, such as formally describing coordinate systems, merging metadata across modalities, and handling derivatives of raw iEEG data. In particular, further discussion is warranted to adapt iEEG-BIDS for non-human subjects and clinical iEEG recordings. As projects such as BIDS make datasets easier to discover and use, it is particularly important to protect the privacy of subjects. BIDS does not directly address privacy concerns - it only provides a structure for how the data should be stored. It is possible for data to be stored with BIDS in a manner that does not divulge subject identity (for example, by removing identifiable images and stripping any patient information from the data file), but this is up to the researcher. Future extensions to the BIDS specification, and documentation from the BIDS community, could help guide researchers in ensuring the privacy of the individuals that have provided their data in a BIDS dataset.

This process will be further improved as the BIDS community continues to grow. Data sharing, reproducibility, and quality control are priority areas of large research consortia, such as the US Brain Research through Advancing Innovative Neurotechnologies (BRAIN) initiative as well as the Human Brain Project (HBP). Within these efforts it has become clear that community-wide accepted data standards are essential16. Within the HBP, iEEG-BIDS has been adopted in the Medical Informatics Platform (where it is intended to be deployed in several hospitals for conducting multicenter studies) (http://humanbrainproject.eu/en/medicine/) as well as the Neuroinformatics Platform (where it is supported in the HBP data sharing platform as well as the HBP interactive atlas viewers) (https://www.humanbrainproject.eu/en/explore-the-brain/neuroinformatics-platform/). These institutional stakeholders will be critical in spreading the adoption of BIDS, and encouraging more voices to guide the evolution of the specification moving forward.

Conclusion

iEEG-BIDS specifies a structured way of storing iEEG data and metadata. BIDS is a community-driven project, and the iEEG-BIDS specification was created after many months of open discussion with the broader iEEG community. One of the core benefits of adopting community standards such as iEEG-BIDS is that it provides a common point that can be the basis for future collaborations. It facilitates reproducibility and cross-modal integration across datasets, experiments, and recording sites.

References

  1. 1.

    Gorgolewski, K. J. et al. The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Sci. Data 3, 160044 (2016).

  2. 2.

    Niso, G. et al. MEG-BIDS, the brain imaging data structure extended to magnetoencephalography. Sci. Data 5, 180110 (2018).

  3. 3.

    Bancaud, J. & Talairach, J. La stéréo-électroencéphalographie dans l’épilepsie: informations neurophysiopathologiques apportées par l’investigation fonctionnelle stéreotaxique. (Masson, 1965).

  4. 4.

    Penfield, W. & Perot, P. The Brain’s Record of Auditory and Visual Experience, a Final Summary and Discussion. Brain 86, 595–696 (1963).

  5. 5.

    Crone, N. E., Korzeniewska, A. & Franaszczuk, P. J. Cortical γ responses: searching high and low. Int. J. Psychophysiol. Off. J. Int. Organ. Psychophysiol 79, 9–15 (2011).

  6. 6.

    Jerbi, K. et al. Task-related gamma-band dynamics from an intracerebral perspective: review and implications for surface EEG and MEG. Hum. Brain Mapp. 30, 1758–1771 (2009).

  7. 7.

    Johnson, E. L. & Knight, R. T. Intracranial recordings and human memory. Curr. Opin. Neurobiol. 31, 18–25 (2015).

  8. 8.

    Miller, K. J., Zanos, S., Fetz, E. E., den Nijs, M. & Ojemann, J. G. Decoupling the cortical power spectrum reveals real-time representation of individual finger movements in humans. J. Neurosci. Off. J. Soc. Neurosci. 29, 3132–7 (2009).

  9. 9.

    Ritaccio, A. et al. Proceedings of the Fifth International Workshop on Advances in Electrocorticography. Epilepsy Behav. EB 41, 183–192 (2014).

  10. 10.

    Pernet, C. R. et al. BIDS-EEG: an extension to the Brain Imaging Data Structure (BIDS) Specification for electroencephalography. Preprint at, https://psyarxiv.com/63a4y/ (2019)

  11. 11.

    Gramfort, A. et al. MEG and EEG data analysis with MNE-Python. Front. Neurosci. 7, 267 (2013).

  12. 12.

    Oostenveld, R., Fries, P., Maris, E. & Schoffelen, J.-M. FieldTrip: Open Source Software for Advanced Analysis of MEG, EEG, and Invasive Electrophysiological Data. Intell Neurosci 2011, 1:1–1:9 (2011).

  13. 13.

    Stolk, A. et al. Integrated analysis of anatomical and electrophysiological human intracranial data. Nat. Protoc. 13, 1699 (2018).

  14. 14.

    Groppe, D. M. et al. iELVis: An open source MATLAB toolbox for localizing and visualizing human intracranial electrode data. J. Neurosci. Methods 281, 40–48 (2017).

  15. 15.

    Tadel, F., Baillet, S., Mosher, J. C., Pantazis, D. & Leahy, R. M. Brainstorm: A user-friendly application for MEG/EEG analysis. Computational Intelligence and Neuroscience. 2011, https://doi.org/10.1155/2011/879716 (2011).

  16. 16.

    Ferguson, A. R., Nielson, J. L., Cragin, M. H., Bandrowski, A. E. & Martone, M. E. Big data from small data: data-sharing in the “long tail” of neuroscience. Nature Neuroscience. 17, 1442–1447, https://doi.org/10.1038/nn.3838 (2014).

  17. 17.

    Wang, L., Mruczek, R. E. B., Arcaro, M. J. & Kastner, S. Probabilistic Maps of Visual Topography in Human Cortex. Cereb. Cortex N. Y. N 1991 25, 3911–3931 (2015).

Download references

Acknowledgements

We are grateful to Cyril Pernet and the EEG-BIDS team for sharing their article draft of the EEG-BIDS specification and to Elizabeth Dupre and Patrick Park for their help with the bids-starter-kit. This work was supported by: The National Institute of Neurological Disorders and Stroke (NINDS) under award number R37NS21135. The Gordon and Betty Moore Foundation through grant GBMF3834 and by the Alfred P. Sloan Foundation through grant 2013-10-27 to the University of California, Berkeley to CH. The Netherlands Organisation for Scientific Research (NWO, 016.VENI.178.048) to DH. The European Research Council under the European Union’s Seventh Framework Programme (FP/2007-2013)/ERC Grant Agreement no. 616268 F-TRACT to OD. The European Union’s Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreement No. 785907 (Human Brain Project SGA2), 720270 (Human Brain Project SGA1) to OD and LZ. ERC grant 320708, ‘iCONNECT’ to NFR. Marie Sklodowska-Curie Global Fellowship (658868) to AS. National Institute of Mental Health Award R24-MH114705-01 to KG, The Van Wagenen Foundation to KJM, The NIH, NIMH, BRAIN Initiative grant #: R01MH111417 to NP, NFR, and JW, ERC Grant Agreement no. 616268 F-TRACT to FT. NSF ERC EEC-1028725 to JO. The Sloan Research Fellowship (FG-2015-66057), the Whitehall Foundation (2017-12-73) to BV. The National Science Foundation under grant BCS-1736028 to BV.

Author information

C.R.H. managing process for specification, writing the paper, creating survey and analyzing results, coordinating with working group throughout process, updating the validator, adding filtered speech dataset, development of BIDS tooling (pybv and mne-bids). D.H. managing process for specification, writing the paper, development of bids tools: creating bids-starter-kit, coordinating with working group throughout process, adding visual and motor dataset. Working group: S.A. ensure compatibility with EEG-BIDS and collaboratively write software code in MNE-BIDS, pybv, and the BIDS-validator. Been involved in discussions on suitable data formats and actively participated in shaping the extension via the forums and the google doc. S.B. verify specification for ECoG and electrical stimulation data. K.B. verify specification for compatibility with NWB. S.D.A. verify specification for electrical stimulation data. OD1: verify specification for electrical stimulation data and usability within EU Human Brain Project; contribute sEEG epilepsy dataset. OD2: contribute dataset and verify specification for Brain Initiative data. B.D. verify specification for compatibility with NWB. A.F. contribute dataset and verify specification for ECoG. B.L.F. verify specification for ECoG data. K.J.G. mentorship and guidance throughout the specification process. I.G. contribute dataset and verify specification for ECoG. D.G. verify specification of electrode positions and compatibility with iElvis. A.G. verify specification for DBS data. L.H. verify specification for ECoG data. C.J.H. verify specification for ECoG data. M.J. writing software for the validator and MNE-Python. R.T.K. contribute dataset and verify specification for ECoG data. J.P.L. verify specification for use within EU Human Brain Project. J.C.L. verify specification for ECoG, DBS, sEEG data, intraoperative and post-operative photos. B.N.L. verify specification for clinical iEEG data and large datasets. C.L.M. verify specification for clinical iEEG data. K.J.M. contribute dataset and verify specification for DBS and ECoG data. J.O. contribute dataset. R.O. contribute to specification, contribute to validator, review of examples, verify compatibility with EEG-BIDS and MEG-BIDS, implemented support in FieldTrip, outreach and support adoption of draft specification. N.P. verify specification for usability for Brain Initiative data. A.P. verify specification for electrical stimulation data. N.F.R. verify specification for ECoG and Brain Initiative data. A.S. assistance with FieldTrip compatibility with BIDS and other Matlab tools. N.C.S. verify specification for ECoG, sEEG and DBS data. F.T. Contribute sEEG epilepsy dataset, verify specification for sEEG, implemented support in Brainstorm. B.V. verify specification for ECoG data. B.W. verify specification for machine readability in a data archive. J.W. contributed dataset and verify specification for Brain Initiative data. K.W. development of the bids-starter-kit. L.Z. verify specification for use within EU Human Brain Project.

Correspondence to Christopher Holdgraf or Dora Hermes.

Ethics declarations

Competing Interests

Gorgolewski, K. is a part-time Kaggle Research Consultant for Google. Wandell, B. is a co-founder of Flywheel.io, a commercial venture that supports the BIDS standard.

Additional information

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark