42 QFile file(sFilePath);
43 if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
44 qWarning() <<
"[BidsDatasetDescription::read] Cannot open" << sFilePath;
48 QJsonParseError error;
49 QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);
52 if(error.error != QJsonParseError::NoError) {
53 qWarning() <<
"[BidsDatasetDescription::read] Parse error in" << sFilePath
54 <<
":" << error.errorString();
58 QJsonObject json = doc.object();
59 desc.
name = json.value(QStringLiteral(
"Name")).toString();
60 desc.
bidsVersion = json.value(QStringLiteral(
"BIDSVersion")).toString();
61 desc.
datasetType = json.value(QStringLiteral(
"DatasetType")).toString();
62 desc.
license = json.value(QStringLiteral(
"License")).toString();