bids
Use this skill when working with Brain Imaging Data Structure (BIDS) datasets: organizing neuroscience and biomedical data (MRI, EEG, MEG, iEEG, PET, microscopy, NIRS, motion capture, EMG, MR spectroscopy, behavioral), querying BIDS layouts, validating compliance, converting DICOM to BIDS, writing metadata sidecars, or creating BIDS derivatives.
Author
Category
File ManagementInstall
Hot:6
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-bids&locale=en&source=copy
BIDS - Neuroimaging Data Organization and Management Standard
Skill Overview
The BIDS (Brain Imaging Data Structure) skill helps you organize neuroscience and biomedical data according to international standards. It supports standardized management, validation, querying, and conversion for data from 11 modalities, including MRI, EEG, MEG, iEEG, and PET.
Applicable Scenarios
1. Standardized Organization of Neuroimaging Data
When you need to organize and standardize fMRI, structural MRI, diffusion MRI, and other neuroimaging data, this skill can help you construct directory structures that comply with the BIDS v1.11.x specification and meet the requirements of international repositories such as OpenNeuro and DANDI, ensuring that datasets are clearly readable by both humans and software tools.
2. Conversion of Raw DICOM Data
DICOM data exported from medical imaging devices must be converted to standardized BIDS format for subsequent analysis. Using tools such as HeuDiConv and dcm2bids, you can perform fully automated ReproIn protocol mapping or customized heuristic conversion, while preserving records of the original data sources to ensure reproducibility.
3. Dataset Validation and Quality Control
Before data sharing, manuscript submission, or analysis, use bids-validator to quickly check whether a dataset complies with the BIDS specification, identify missing files, naming errors, missing metadata, and other issues, and configure
.bidsignore to exclude auxiliary files that do not need to be validated.Core Functions
1. PyBIDS Data Querying and Indexing
Based on the PyBIDS library, this skill provides efficient BIDS dataset indexing and querying. It supports flexible file retrieval by entities such as subject, session, task, run, and modality; automatically inherits metadata from sidecars; and can cache indexes to accelerate access to large datasets. It also supports querying preprocessed files generated by derivative pipelines such as fMRIPrep.
2. Multimodal Metadata Management
Create and maintain JSON sidecar metadata files for different modalities, including MRI, EEG, MEG, and PET. Use the inheritance mechanism to share acquisition parameters—such as RepetitionTime, TaskName, and PhaseEncodingDirection—across multiple levels, including the dataset, subject, and session levels, ensuring that critical parameters required by fMRI preprocessing pipelines, such as slice timing and phase encoding, are complete and accurate.
3. BIDS Derivatives and Pipeline Integration
Generate preprocessing outputs that comply with the BIDS Derivatives specification, such as those produced by fMRIPrep, MRIQC, and QSIPrep. Correctly use entities such as
space-, desc-, and res- to label template space, processing steps, and resolution. Create a dataset_description.json containing the GeneratedBy field to ensure that derivative data can be correctly recognized and processed by downstream pipelines and tools.Frequently Asked Questions
What is the BIDS standard, and why is it needed?
BIDS (Brain Imaging Data Structure) is a community data standard in the field of neuroscience that defines unified file naming conventions, directory structures, and metadata formats. Using BIDS allows datasets to be immediately recognized by mainstream tools such as fMRIPrep and MRIQC, meet the requirements of repositories such as OpenNeuro and DANDI and journals such as NeuroImage, and substantially improve research reproducibility and data-sharing efficiency. BIDS originated with MRI and has now expanded to 11 modalities, including EEG, MEG, iEEG, PET, microscopy, and NIRS.
How can scanner DICOM data be converted to BIDS format?
HeuDiConv is recommended for converting DICOM to BIDS. If the scanning protocol follows the ReproIn naming conventions—such as
anat-T1w and func-bold_task-rest—the conversion can be fully automated without writing a configuration file. For nonstandard protocol names, you can write a Python heuristic file for mapping. During conversion, be sure to use the --minmeta flag to avoid metadata overflow. The original DICOM files will be automatically archived in the sourcedata/ directory. Alternative tools include dcm2bids, which is based on JSON configuration, and BIDScoin, which provides a graphical interface.What should I do if bids-validator reports “Not a BIDS dataset” or “Missing SliceTiming” errors?
“Not a BIDS dataset” usually indicates that the root directory is missing a
dataset_description.json file. Create a JSON file containing the Name and BIDSVersion fields. “Missing SliceTiming” indicates that dcm2niix was unable to extract slice-timing information from the DICOM header. You need to manually add a SliceTiming array to the JSON sidecar according to the scanning protocol; common patterns include ascending, descending, and interleaved acquisition. For other common issues, such as inconsistent-subject warnings, you can use --ignoreSubjectConsistency to ignore them. TSV file errors are typically caused by encoding or delimiter problems; use UTF-8 encoding and tab delimiters, and represent missing values as n/a.