The Brain Imaging Data Structure (BIDS) is a community standard for organizing and describing neuroscience and biomedical research datasets. It defines a consistent file naming convention, directory hierarchy, and metadata schema so that datasets are immediately understandable by humans and software tools alike. BIDS is governed by the BIDS Specification (reviewed against v1.11.2, released 2026-09-29) and is maintained by the community via the BIDS-Standard GitHub organization.
While BIDS originated for MRI, it has grown well beyond neuroimaging. The specification now covers 11 modalities spanning imaging, electrophysiology, and behavioral data:
Active BEPs are extending BIDS further — notably BEP032 (microelectrode electrophysiology) proposes support for extracellular recordings including Neuropixels probes, bringing BIDS to a prevalent methodology in animal neuroscience research (see also the neuropixels-analysis skill).
Repository submission requirements vary by modality and archive; check the target archive before preparing a deposit.
The Python ecosystem for BIDS centers on PyBIDS (pybids) for querying and indexing BIDS datasets, and the bids-validator (Deno-based, available as PyPI package bids-validator-deno or via Deno directly) for compliance checking. Conversion from DICOM is typically done with HeuDiConv, dcm2bids, or BIDScoin.
Apply this skill when:
dataset_description.json for a new dataset.bidsignore to exclude files from validation# Core BIDS querying library
uv pip install pybids
# BIDS validator (Deno-based, installed via PyPI wrapper)
uv pip install bids-validator-deno
# Alternative: install directly via Deno
# deno install -ERWN -g -n bids-validator jsr:@bids/validator
# DICOM-to-BIDS converters (install as needed)
uv pip install heudiconv # HeuDiConv - heuristic-based DICOM conversion
uv pip install dcm2bids # dcm2bids - config-file-based conversion
# BIDScoin: uv pip install bidscoin
# Useful companions
uv pip install nibabel # NIfTI/other neuroimaging file I/O
uv pip install pydicom # DICOM file reading (used by converters)
Twelve workflow areas, each with worked code, are documented in
references/core_workflows.md:
dataset_description.json — the required fields and how to generate it.BIDSLayout, entity filters, sidecar metadata withautomatic inheritance, and building paths from entities.
bids-validator via the PyPI wrapper (recommended), via Denodirectly, the legacy Node validator, and using .bidsignore to exclude files.
reconnaissance → heuristic → convert sequence) and dcm2bids (config-file based).
participants.tsv and its data dictionary.dataset_description.json.DataFrame output.
Validate with the BIDS validator as well as indexing with PyBIDS. Successful indexing
is not a full compliance check; record the validator and BIDS schema versions, and
inspect warnings and metadata inheritance before analysis.
This skill includes detailed reference documentation:
From the skill directory, update schema and BEPs with python scripts/update_schema.py.
The bundled snapshot is BIDS 1.11.2 / schema 2.0.0; BEP proposals are not adopted requirements.
If ReadTheDocs blocks an automated fetch, use the documented versioned GitHub export in the updater help.
Cause: Missing dataset_description.json at the root.
Fix: Create the file with at minimum {"Name": "...", "BIDSVersion": "1.11.2"}.
Cause: Not all subjects have the same set of files (some missing sessions, runs, etc.).
Fix: Review severity and the exact issue code in the validator JSON report and document missing data in participants.tsv or scans.tsv. The current schema validator does not provide the legacy --ignoreSubjectConsistency flag; use a narrowly scoped --config only for reviewed exceptions.
Cause: dcm2niix couldn't extract slice timing from DICOM headers.
Fix: Recover actual slice acquisition offsets from scanner metadata or a verified sequence protocol. Slice order alone does not determine timing, especially with multiband acquisition or dead time. Store offsets in seconds in slice-index order, accounting for SliceEncodingDirection; document missing timing instead of inventing it.
Cause: Axis labels (i/j/k vs x/y/z vs LR/AP/SI) are confusing.
Fix: In BIDS, use NIfTI image axes: i=first axis, j=second, k=third. - means negative direction. Anatomical direction depends on the NIfTI affine and converter orientation; do not infer j or its sign from an AP/PA series label alone. Verify against scanner metadata and the image orientation.
Cause: Full filesystem indexing on every BIDSLayout() call.
Fix: Use database_path to cache the index in a directory outside the dataset:
layout = BIDSLayout("/data", database_path="/cache/pybids")
# After dataset changes, rebuild with reset_database=True.
Cause: Derivatives directory missing its own dataset_description.json.
Fix: Every derivatives directory must have dataset_description.json with "DatasetType": "derivative".
Cause: onset times are relative to the wrong reference (e.g., trigger time vs first volume).
Fix: Onsets are seconds relative to the first stored data point in the corresponding recording. If dummy volumes were discarded before storage, reset time zero to the first retained volume; negative onsets are allowed.
Cause: Encoding or delimiter issues (spaces instead of tabs, BOM characters).
Fix: Ensure tab-separated values with UTF-8 encoding and Unix line endings (\n). Use n/a (not NA, NaN, or empty) for missing values.
TaskName, scanner parameters) in top-level sidecar files rather than duplicating in every subject's directory.sourcedata/ is excluded from raw BIDS validation, not deidentified. Review identifiers before any sharing.README describing the study design, acquisition parameters, known issues, and any deviations from BIDS.```
filename acq_time quality
func/sub-01task-restbold.nii.gz 2025-01-15T10:30:00 good
```
CHANGES to document dataset modifications. Consider DataLad for full version control of large datasets.pydeface, mri_deface, or afni_refacer). Store defaced versions as the primary data or use _defacemask files.bids:raw:sub-01/anat/sub-01_T1w.nii.gz for raw sources and define "DatasetLinks": {"raw": "../.."} when the derivative root is raw/derivatives/pipeline/. bids:: resolves within the current dataset, which in a derivative is the derivative dataset.BEPs are community-driven proposals to extend BIDS to new modalities, derivatives, or metadata. The full list with status, leads, and links is in references/beps.yml (fetched from the bids-website). BEP-specific schema previews are rendered at https://github.com/bids-standard/bids-schema/tree/main/BEPs.
The bundled BEP listing was refreshed on 2026-09-30. Read each entry's proposal/PR and
status before using draft entities; BEP032 remains a proposal, not part of stable 1.11.2.
Use the repository directory listing to discover preview schema paths; do not assume aBEPs/BEP032/schema.json URL exists.
Related standards:
| Tool | Purpose |
|---|---|
| fMRIPrep | fMRI preprocessing (produces BIDS derivatives) |
| MRIQC | MRI quality control (produces BIDS derivatives) |
| QSIPrep | Diffusion MRI preprocessing |
| TemplateFlow | Neuroimaging templates and atlases with BIDS-like naming |
| Fitlins | BIDS Stats Models implementation |
| DataLad | Version control for large datasets, integrates with BIDS |
| OpenNeuro | Free BIDS dataset repository |
| DANDI | Neurophysiology data archive (uses BIDS for some modalities) |
| HeuDiConv | DICOM-to-BIDS with heuristic Python files |
| dcm2bids | DICOM-to-BIDS with JSON config |
| BIDScoin | DICOM-to-BIDS with GUI and YAML config |
| nwb2bids | Convert NWB (Neurodata Without Borders) files to BIDS |
| CuBIDS | BIDS dataset curation and harmonization |
| bids2table | Efficient tabular indexing of BIDS datasets |
| bids-examples | Canonical collection of prototypical BIDS datasets for all modalities |