Comprehensive Rust tools for BIDS (Brain Imaging Data Structure) datasets.
This is the umbrella crate that re-exports all bids-* sub-crates, providing
a single dependency for full BIDS dataset support. It is the Rust equivalent
of the PyBIDS Python package.
Quick Start
use bids::{BidsLayout, BidsFile};
let layout = BidsLayout::new("/path/to/bids/dataset").unwrap();
let files = layout.get()
.suffix("bold")
.extension(".nii.gz")
.subject("01")
.collect()
.unwrap();
for f in &files {
println!("{}: {:?}", f.filename, f.entities);
}
Crate Organization
- Core ([
core]) — Fundamental types: files, entities, metadata, config, errors - I/O ([
io]) — TSV/JSON reading, path building, file writing - Layout ([
layout]) — Dataset indexing and fluent query API - Variables ([
variables]) — BIDS variable system for statistical modeling - Modeling ([
modeling]) — BIDS-StatsModels, HRF functions, transformations - Reports ([
reports]) — Auto-generated methods sections - Domain crates — Modality-specific support (EEG, MEG, PET, etc.)
- Infrastructure — NIfTI parsing, signal filtering, formula parsing, schema validation
Feature Flags
| Feature | Description |
|---|---|
ndarray |
Enable ndarray integration for EEG (Array2) and NIfTI (ArrayD) |
safetensors |
Enable safetensors export for ML frameworks |
mmap |
Enable memory-mapped NIfTI access via memmap2 |
arrow |
Enable Apache Arrow / Parquet export for dataset manifests |