A primer to BIDS

A 10-minute (or so) introduction to the Brain Imaging Data Structure for busy engineers.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Learning objectives

  • Understand what BIDS is
  • Introduce the core concepts
  • Overview of available tools
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

The Brain Imaging Data Structure

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Definition

A simple and intuitive way to organize and describe your neuroimaging and behavioral data.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

The Brain Imaging Data Structure (BIDS) is a standard specifying the description of neuroimaging data in a filesystem hierarchy and of the metadata associated with the imaging data.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Governance

BIDS is a community-driven effort.

The specification is opensource and contributions are accepted through submission of issues and requests to the GitHub repository.

Governance is driven by a formal leadership structure, which ensures strict application of contribution policies and the code of conduct.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Extensions

Requests for improvement are handled through BIDS Extension Proposals (BEP).

BEPs are incubated within special interest groups, prior to proposal for inclusion to the specification.

Once accepted, the BEP is officially included in the next release of the specification.

Notable BEPs: EEG, MEG, PET, Microscopy
WIP: DWI derivatives, PET derivatives, Provenance

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Concepts

  • Datasets
  • File collections
  • Metadata
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Datasets

  • Source, raw and derivative datasets
  • Minimal requirements
  • Storage convention
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Types of dataset

Raw dataset

  • A BIDS-compliant dataset containing the raw data of the study.

Source dataset

  • A non BIDS-compliant dataset containing the source data of the study before normalisation to BIDS.

Derivative dataset

  • A BIDS-like dataset containing artifacts processed from a raw dataset and other derivatives possibly.
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Minimal requirements

dataset_description.json

{
    "Name": "This dataset",
    "BIDSVersion": "1.8.0",
    "DatasetType": "raw" | "derivative",
}
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Storage convention (1)

Embedded (in-tree)

rawdata/
    dataset_description.json
    derivatives/
        pipeline-foo/
            dataset_description.json
       pipeline-bar/
            dataset_description.json 
    sourcedata/
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Storage convention (2)

Standalone (out-of-tree)

sourcedata/
rawdata/
    dataset_description.json
derivatives/
    pipeline-foo/
        dataset_description.json
    pipeline-bar/
        dataset_description.json
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

File collections

  • File naming convention
  • Components and entities
  • Derivatives
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Anatomy of a BIDS file

sub-P01/
    ses-M00/
        anat/
            sub-P01_ses-M00_T1w.nii.gz
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Components and entities

sub-P01/
    ses-M00/
        anat/
            sub-P01_ses-M00_run-01_T1w.nii.gz
            sub-P01_ses-M00_run-02_T1w.nii.gz

Entities: sub, ses, run
Datatype: anat
Suffix: T1w
Extension: .nii.gz

Supported entities by modality.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Derivatives

sub-P01/
    ses-M00/
        anat/
            sub-P01_ses-M00_desc-preproc_T1w.nii.gz

Source entities: sub, ses
Derivative entities: desc

BIDS derivatives are still a work-in-progress. Consider checking for in-progress BEP first, before reaching for your own implementation.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Metadata

  • Modality-agnostic metadata
  • Modality-specific metadata
  • Inheritence principle
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Modality-agnostic metadata

Modality-agnostic metadata are defined in tabular format and serialised to TSV.

participants.tsv                        # participant-level metadata
sub-P01/
    sub-P01_sessions.tsv                # session-level metadata
    ses-M00/
        sub-P01_ses-M00_scans.tsv       # scan-level metadata

Example: participants.tsv

participant_id age sex handedness group
sub-P01 36 M n/a control
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Modality-specific metadata

Modality-specific metadata are defined in dictionary format and serialised to JSON.

sub-P01/
    ses-M00/
        anat/
            sub-P01_ses-M00_T1w.nii.gz
            sub-P01_ses-M00_T1w.json    # Modality-specific metadata

Example sidecar JSON metadata:

{
    "MagneticFieldStrength": 3,         /* DICOM tag 0018, 0087 */
    "MRAcquisitionType": "3D",          /* DICOM tag 0018, 0023 */
    "EchoTime": 0.00298                 /* DICOM tag 0018, 0081 */
}
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Inheritence principle

⚠️ OPTIONAL

T1w.json                                # Dataset-wide definition
sub-P01/
    sub-P01_T1w.json                    # Participant-specific overrides
    ses-M00/
        anat/
            sub-P01_T1w.nii.gz
            sub-P01_T1w.json            # Modality-specific overrides

Modality-specific metadata computed by dictionary merging from root to leaf.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Ecosystem around BIDS

  • Publicly available datasets
  • Official tools and libraries
  • Starter kit
Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

https://github.com/bids-standard/bids-examples

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

https://openneuro.org/

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Official libraries

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Converters

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Validator

https://github.com/bids-standard/bids-validator

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Starter kit

https://bids-standard.github.io/bids-starter-kit/

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022

Questions

Thank you for your attention.

Ghislain Vaillant | A primer to BIDS | Inria Digital Health Meetup 2022