64 QFile file(sFilePath);
65 if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
66 qWarning() <<
"[BidsDatasetDescription::read] Cannot open" << sFilePath;
70 QJsonParseError error;
71 QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);
74 if(error.error != QJsonParseError::NoError) {
75 qWarning() <<
"[BidsDatasetDescription::read] Parse error in" << sFilePath
76 <<
":" << error.errorString();
80 QJsonObject json = doc.object();
81 desc.
name = json.value(QStringLiteral(
"Name")).toString();
82 desc.
bidsVersion = json.value(QStringLiteral(
"BIDSVersion")).toString();
83 desc.
datasetType = json.value(QStringLiteral(
"DatasetType")).toString();
84 desc.
license = json.value(QStringLiteral(
"License")).toString();