Mmcp.market

bids skill

by K-Dense-AI·K-Dense-AI/scientific-agent-skills·47k stars·MIT

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.

A100/100content scan

Is the bids skill safe?

Clean: nothing in its files matched our rules. We read 7 files in the folder on 2026-09-28.

No findings.

Install the bids skill

A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.

git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/scientific-agent-skills/skills/bids ~/.claude/skills/bids
available in every project

In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub

The instructions your agent would load

SKILL.md as published, without the frontmatter. Read it on GitHub

Brain Imaging Data Structure (BIDS)

Overview

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 (currently v1.11.x) 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:

  • Imaging: MRI (structural, functional, diffusion, fieldmaps, perfusion/ASL), PET, microscopy
  • Electrophysiology: EEG, MEG, iEEG (intracranial EEG), EMG
  • Other: NIRS (near-infrared spectroscopy), motion capture, behavioral data (without imaging), MR spectroscopy

Active BEPs are extending BIDS further — notably BEP032 (microelectrode electrophysiology) will add support for extracellular recordings including Neuropixels probes, bringing BIDS to a prevalent methodology in animal neuroscience research (see also the neuropixels-analysis skill).

Adoption is required or strongly encouraged by major data repositories (OpenNeuro, DANDI), leading journals (NeuroImage, Human Brain Mapping, Scientific Data), and funding agencies (NIH, ERC).

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.

When to Use This Skill

Apply this skill when:

  • Organizing raw neuroscience data (imaging, electrophysiology, behavioral) into BIDS-compliant directory structures
  • Querying an existing BIDS dataset to find specific files by subject, session, task, run, or modality
  • Validating a dataset against the BIDS specification before sharing or submission
  • Converting DICOM data from scanners into BIDS format
  • Writing or editing JSON sidecar metadata files
  • Creating BIDS-compliant derivatives (preprocessed data, analysis outputs)
  • Setting up a dataset_description.json for a new dataset
  • Working with BIDS entities (subject, session, task, acquisition, run, etc.)
  • Configuring .bidsignore to exclude files from validation
  • Preparing data for upload to OpenNeuro, DANDI, or other BIDS-aware repositories

Installation

# 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 -g -A npm: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)

Core Workflows

Twelve workflow areas, each with worked code, are documented in references/core_workflows.md:

automatic inheritance, and building paths from entities.

  1. BIDS directory structure — the required layout and where each modality belongs.
  2. datasetdescription.json** — the required fields and how to generate it.
  3. Querying with PyBIDS — BIDSLayout, entity filters, sidecar metadata with

directly, the legacy Node validator, and using .bidsignore to exclude files.

  1. Validation — bids-validator via the PyPI wrapper (recommended), via Deno

reconnaissance → heuristic → convert sequence) and dcm2bids (config-file based).

  1. Entities and file naming — the entity order and naming grammar.
  2. DICOM to BIDS conversion — HeuDiConv (including the turnkey ReproIn path and the

DataFrame output.

  1. Metadata sidecars — required and recommended JSON fields per modality.
  2. Events files — task fMRI event timing and column conventions.
  3. Participants file — participants.tsv and its data dictionary.
  4. Derivatives — the derivatives layout and its dataset_description.json.
  5. Advanced PyBIDS — index caching, including derivatives, confound regressors, and
  1. BIDS-Apps — the standard invocation pattern, and fMRIPrep, MRIQC, and QSIPrep.

Validate early and often: PyBIDS validates structure when it indexes a dataset, so an indexing failure usually means a naming or metadata problem rather than a code bug.

Reference Materials

This skill includes detailed reference documentation:

  • bidsschema.json**: Machine-readable BIDS schema (from https://bids-specification.readthedocs.io/en/stable/schema.json). This is the authoritative source for entity definitions, ordering rules, filename templates, allowed suffixes per datatype, and metadata field requirements. BEP-specific schemas are at https://github.com/bids-standard/bids-schema/tree/main/BEPs.
  • beps.yml: Current list of all BIDS Extension Proposals with titles, leads, status, and links (from bids-website)
  • bidsspecification.md**: Human-readable summary of the entity table, datatype reference, directory structure rules, template spaces, and specification changelog
  • metadatafields.md**: Required and recommended JSON sidecar fields for every BIDS modality (anat, func, dwi, fmap, eeg, meg, pet, etc.)
  • conversiontools.md**: Detailed workflows for HeuDiConv, dcm2bids, and BIDScoin including heuristic/config examples and troubleshooting

Update schema and BEPs with: python scripts/update_schema.py

Common Issues and Solutions

1. Validator reports "Not a BIDS dataset"

Cause: Missing datasetdescription.json at the root. Fix**: Create the file with at minimum {"Name": "...", "BIDSVersion": "1.10.0"}.

2. Inconsistent subjects warning

Cause: Not all subjects have the same set of files (some missing sessions, runs, etc.). Fix: This is a warning, not an error. Use --ignoreSubjectConsistency if intentional. Document missing data in participants.tsv or a scans.tsv.

3. Missing SliceTiming

Cause: dcm2niix couldn't extract slice timing from DICOM headers. Fix: Determine slice order from the scan protocol and add manually to the JSON sidecar. Common patterns: ascending, descending, interleaved (odd-first or even-first).

4. Phase encoding direction confusion

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. For standard axial acquisitions: j is typically anterior-posterior. Verify with the acquisition protocol.

5. PyBIDS is slow on large datasets

Cause: Full filesystem indexing on every BIDSLayout() call. Fix: Use database_path to cache the index to an SQLite file:

layout = BIDSLayout("/data", database_path="/data/.pybids_cache.db")

6. Derivatives not found by PyBIDS

Cause: Derivatives directory missing its own datasetdescription.json. Fix: Every derivatives directory must have datasetdescription.json with "DatasetType": "derivative".

7. Events file timing is off

Cause: onset times are relative to the wrong reference (e.g., trigger time vs first volume). Fix: Onsets must be in seconds relative to the first volume of that run's acquisition. Account for dummy scans if they were discarded.

8. TSV files fail validation

Cause: Encoding or delimiter issues (spaces instead of tabs, BOM characters, Windows line endings). 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.

Best Practices

  1. Validate early and often - Run the BIDS validator after every conversion or modification. Fix errors before they compound.
  1. Use metadata inheritance - Place shared metadata (e.g., TaskName, scanner parameters) in top-level sidecar files rather than duplicating in every subject's directory.
  1. Keep sourcedata - Store the original DICOM (or other raw) data under sourcedata/ so conversions are reproducible. Add sourcedata/ to .bidsignore.
  1. Use consistent naming from the start - Define your BIDS naming scheme before data collection. Use the ReproIn naming convention for scan protocols to enable automatic conversion.
  1. Document your dataset - Write a thorough README describing the study design, acquisition parameters, known issues, and any deviations from BIDS.
  1. Use scans.tsv for run-level metadata - Record per-run acquisition times and quality notes:
filename	acq_time	quality
   func/sub-01_task-rest_bold.nii.gz	2025-01-15T10:30:00	good
  1. Version your dataset - Use CHANGES to document dataset modifications. Consider DataLad for full version control of large datasets.
  1. Deface anatomical images - Remove facial features from T1w/T2w images before sharing (e.g., using pydeface, mrideface, or afnirefacer). Store defaced versions as the primary data or use _defacemask files.
  1. Use BIDS URIs for provenance - In derivatives, reference source files using BIDS URIs: bids::sub-01/anat/sub-01_T1w.nii.gz.
  1. Prefer community tools - Use established BIDS-Apps (fMRIPrep, MRIQC, QSIPrep) rather than custom pipelines when possible. They handle BIDS I/O correctly and produce BIDS-compliant derivatives.
  1. Study bids-examples - The bids-examples repository is the canonical collection of prototypical BIDS datasets covering different modalities and use cases (MRI, fMRI, DWI, EEG, MEG, iEEG, PET, ASL, genetics, derivatives, and more). Use it as a reference when structuring your own dataset, as test data for BIDS tools, or to understand how a specific modality should be organized. Each example passes the BIDS validator.

More skills from K-Dense-AI/scientific-agent-skills

  • AadaptyvHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.
  • AaeonThis skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
  • AalphagenomeLook up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.
  • Aanalytical-method-validationPlan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include "method validation", "analytical method validation", "AMV", "validation protocol", "acceptance criteria", "linearity", "reportable range", "accuracy and precision", "repeatability", "intermediate precision", "recovery", "LOD", "LOQ", "detection limit", "quantitation limit", "specificity", "robustness", "method transfer", "method comparison", "Deming", "Passing-Bablok", "Bland-Altman", "equivalence testing", "OOS investigation", "ICH Q2", "Q2(R2)", "Q14", "USP 1225", "ICH M10", "incurred sample reanalysis", "ISR", "CLSI EP", and any request to show that an assay works.
  • AanndataData structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
  • AarborAutonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g. "get my model's eval score up", "improve this agent/harness", "tune this pipeline", "beat the baseline on this benchmark", "run a search over approaches and keep the best", "do an MLE-bench / Kaggle-style optimization", or any long-horizon "make this artifact better and don't just memorize the dev set" task. Trigger it even when the user doesn't say "Arbor" or "hypothesis tree" but describes repeated experiment-and-evaluate loops, branching exploration of competing ideas, or worries about a dev/test gap. Runs Claude itself as the coordinator with subagent executors in isolated git worktrees; for the standalone `arbor` CLI tool see references/arbor-upstream.md.
  • AarboretoInfer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.
  • AastropyCore Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.
  • AautoskillObserve the user's screen via screenpipe, detect repeated research workflows, match them against existing scientific-agent-skills, and draft new skills (or composition recipes that chain existing ones) for the patterns not yet covered. Use when the user asks to analyze their recent work and propose skills based on what they actually do. Requires the screenpipe daemon (https://github.com/screenpipe/screenpipe) running locally on port 3030 — the skill has no other data source and will refuse to run if screenpipe is unreachable. All detection runs locally; only redacted cluster summaries reach the LLM.
  • Abenchling-integrationBenchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.
  • Abgpt-paper-searchSearch scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.
  • AbiopythonComprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

All agent skills → · MCP servers