ReadonlydatasetThe dataset's root directory as an absolute path (Node.js context).
The BIDS file accessor.
Map of BIDS sidecar files that contain HED annotations.
Load and set the HED schemas for this dataset.
A promise that resolves to an array of issues encountered during schema loading.
Find and parse all JSON sidecar files in the dataset.
A promise that resolves to an array of issues encountered during sidecar parsing.
This method iterates through the dataset's files, identifies JSON sidecars with HED data, parses them into BidsSidecar objects, and stores them in BidsDataset.sidecarMap.
Note: This method does not validate the HED data within the sidecars; it only parses them.
Validate the full BIDS dataset for HED compliance.
A promise that resolves to an array of issues found during validation.
This method validates all HED data in the dataset, including:
Note: If any of the sidecars have errors (not just warnings), the TSV files will not be validated. This is because a single error in a sidecar can result in errors on every line of a TSV file.
Validate the JSON sidecars in the dataset.
An array of issues found during sidecar validation.
Validate the TSV files in the dataset.
A promise that resolves to an array of issues found during TSV validation.
StaticcreateFactory method to create a BidsDataset. This method, rather than the constructor should always be used to create a BidsDataset instance.
The root directory of the dataset or a file-like object.
The BidsFileAccessor class to use for accessing files.
A Promise that resolves to a two-element array containing the BidsDataset instance (or null if creation failed) and an array of issues.
A BIDS dataset.
Remarks
This class organizes and provides access to the files and metadata within a BIDS dataset. It is designed to be used for HED validation of BIDS datasets.
The BidsDataset should not be created with the constructor. Instead, it should be created using the asynchronous BidsDataset.create factory method. This method handles the initial setup and file discovery.
BidsDataset creation will return a null dataset if any of the sidecars have invalid JSON, or it cannot find and load the needed HED schemas.
Example