Skip to content

Commit 5a4de2d

Browse files
authored
Merge pull request #340 from suyashdb/checkdatasetdescriptionJSON
Check datasetdescription.json
2 parents 01728a1 + ca2f57f commit 5a4de2d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

validators/bids.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ BIDS = {
149149
participants = null,
150150
phenotypeParticipants = [],
151151
hasSubjectDir = false;
152+
var hasDatasetDescription = false;
152153

153154
var summary = {
154155
sessions: [],
@@ -206,6 +207,11 @@ BIDS = {
206207
hasSubjectDir = true;
207208
}
208209

210+
// check for dataset_description.json presence
211+
if (path === '/dataset_description.json') {
212+
hasDatasetDescription = true;
213+
}
214+
209215
// ignore associated data
210216
if (utils.type.isAssociatedData(file.relativePath)) {
211217
process.nextTick(cb);
@@ -389,6 +395,9 @@ BIDS = {
389395
if (!hasSubjectDir) {
390396
self.issues.push(new Issue({code: 45}));
391397
}
398+
if (!hasDatasetDescription) {
399+
self.issues.push(new Issue({code: 57}));
400+
}
392401
// check if participants file match found subjects
393402

394403
if (participants) {

0 commit comments

Comments
 (0)