Expand description
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 |
Re-exports§
pub use bids_core as core;pub use bids_io as io;pub use bids_layout as layout;pub use bids_variables as variables;pub use bids_validate as validate;pub use bids_derive as derive;pub use bids_modeling as modeling;pub use bids_reports as reports;pub use bids_beh as beh;pub use bids_eeg as eeg;pub use bids_ieeg as ieeg;pub use bids_meg as meg;pub use bids_micr as micr;pub use bids_motion as motion;pub use bids_mrs as mrs;pub use bids_nirs as nirs;pub use bids_perf as perf;pub use bids_pet as pet;pub use bids_dataset as dataset;pub use bids_filter as filter;pub use bids_formula as formula;pub use bids_inflect as inflect;pub use bids_nifti as nifti;pub use bids_schema as schema;
Modules§
- prelude
- Convenience prelude importing the most commonly used types.
Structs§
- Bids
File - Represents a single file in a BIDS dataset.
- Bids
Layout - The main entry point for interacting with a BIDS dataset.
- Bids
Metadata - Ordered metadata dictionary for a BIDS file.
- Bids
Report - Generate publication-quality data acquisition methods from a BIDS dataset.
- Bids
Version - A parsed BIDS specification version (SemVer).
- Config
- Configuration for a BIDS layout, defining entities and path patterns.
- Contrast
Info - Information about a statistical contrast.
- Dataset
Description - Contents of a BIDS
dataset_description.jsonfile. - Entity
- Represents a single entity defined in configuration.
- Gradient
Table - Combined b-value + b-vector gradient table for a DWI acquisition.
- Padded
Int - Integer type that preserves zero-padding.
- Query
Filter - A filter for querying files by entity values.
- Stats
Models Graph - Rooted directed acyclic graph representing a BIDS-StatsModel specification.
Enums§
- Bids
Error - Errors that can occur when working with BIDS datasets.
- Compatibility
- Result of checking a dataset’s BIDS version against the library’s supported version.
- Copy
Mode - How to copy a file to a new location.
- Entity
Value - A typed entity value, preserving the original representation where needed.
- HrfModel
- Hemodynamic Response Function (HRF) model type.
- Invalid
Filters - How to handle unrecognized entity names in query filters.
- Query
- Special query values for entity filtering.
- Scope
- Scope for queries.
Constants§
- MIN_
COMPATIBLE_ VERSION - The minimum BIDS version that this release can read without data loss.
- SUPPORTED_
BIDS_ VERSION - The BIDS specification version that this release of
bids-rstargets.
Traits§
- Time
Series - Trait for read-only access to multichannel time-series data.
Functions§
- collect_
associated_ files - Group BIDSFiles with multiple files per acquisition (multi-echo, multi-part, etc.).
- convert_
json_ keys - Convert CamelCase keys to snake_case recursively in a JSON value.
- matches_
entities - Check whether a file’s entities match the target entities.
Type Aliases§
- Entities
- A map from entity names to their typed values for a single file.
- Result
- A specialized
Resulttype for BIDS operations. - String
Entities - A map from entity names to string values (used in variables/collections).