Skip to main content

Module json

Module json 

Source
Expand description

JSON sidecar file handling for BIDS metadata.

BIDS uses JSON sidecar files to provide metadata for data files. These sidecars follow the BIDS inheritance principle: a sidecar at a higher directory level applies to all matching data files below it, and can be overridden by more-specific sidecars closer to the data file.

This module provides functions for reading, merging, and discovering JSON sidecars.

Functionsยง

find_sidecars
Find all applicable JSON sidecar files for a given data file, walking up the directory tree (BIDS inheritance principle).
merge_json_sidecars
Merge JSON sidecars following BIDS inheritance: more-specific files override less-specific ones.
read_json
Read a JSON file and return it as a generic serde_json::Value.
read_json_sidecar
Read a JSON sidecar file and return it as BidsMetadata.