BidsDatasetDescription
Namespace: BIDSLIB · Library: BIDS Library
#include <bids/bids_dataset_description.h>
struct BIDSLIB::BidsDatasetDescription
Dataset-level metadata from dataset_description.json.
Every BIDS dataset must contain a dataset_description.json at its root. This struct captures the required and recommended fields.
src/examples/ex_bids/main.cpp
const BidsDatasetDescription description = BidsDatasetDescription::read(root + "/dataset_description.json");
const QList<BidsChannel> channels = BidsChannel::readTsv(channelsTsv); // one row per channel
const QList<BidsEvent> events = BidsEvent::readTsv(ieeg.eventsTsvPath().filePath()); // onset, duration, sample, value, trial_type
const QList<BidsElectrode> electrodes = BidsElectrode::readTsv(ieeg.electrodesTsvPath().filePath());
const BidsCoordinateSystem coords = BidsCoordinateSystem::readJson(ieeg.coordsystemJsonPath().filePath());
Static Methods
read(sFilePath)
Read a dataset_description.json file.
Parameters:
- sFilePath : const QString & Path to dataset_description.json.
Returns:
- BidsDatasetDescription — Populated description, or default if file cannot be read.
write(sFilePath, desc)
Write a dataset_description.json file.
Parameters:
-
sFilePath : const QString & Output path.
-
desc : const BidsDatasetDescription & Dataset description to write.
Returns:
- bool — true on success.
Example
- Full source:
src/examples/ex_bids/main.cpp - Build target:
ex_bids(runs under CTest)