Skip to main content

Crate bids_validate

Crate bids_validate 

Source
Expand description

BIDS dataset validation utilities.

Provides functions for validating BIDS dataset roots, derivative directories, and file indexing patterns. Used by bids-layout during dataset indexing to determine which files to include or exclude.

§Root Validation

validate_root() checks that a path exists, is a directory, and contains a valid dataset_description.json. If validation is enabled, the description is parsed and checked for required fields.

§Derivative Validation

validate_derivative_path() ensures derivative datasets have a valid dataset_description.json with pipeline information (either GeneratedBy or the legacy PipelineDescription).

§Ignore / Force Patterns

Default ignore patterns exclude code/, models/, sourcedata/, stimuli/, hidden files (.-prefixed), and common non-BIDS directories. These can be overridden with custom patterns via validate_indexing_args().

Structs§

ValidationIssue
A single validation issue found in a BIDS dataset.
ValidationResult
Result of a full dataset validation.

Statics§

DEFAULT_IGNORE
Directories to ignore by default during indexing.

Functions§

is_bids_file
Check if a path matches BIDS naming conventions (basic validation).
resolve_intended_for
Resolve a BIDS URI or relative IntendedFor path to an absolute path.
should_force_index
Check if a path should be force-indexed.
should_ignore
Check if a path should be ignored during indexing.
validate_dataset
Perform a full BIDS validation of a dataset directory.
validate_derivative_path
Validate a derivatives directory and return the pipeline name.
validate_indexing_args
Validate and sort indexing arguments.
validate_root
Validate the root directory of a BIDS dataset.