bids-apps/oppni

Input data is not validated

Closed this issue · 2 comments

we should at least check if it's BIDS

Hey Chris,

I installed bids-validation using npm on CentOS, and it seems to not run properly on the latest downloads of ds114_test[12] - see below. Any ideas?

$ 09:32:48 miner ~ >> /home/praamana/node_modules/.bin/bids-validator /sgehome/BIDS-examples/ds114_test1/

/home/praamana/node_modules/bids-validator/validators/bids.js:115
if (path.startsWith('/sub-')) {hasSubjectDir = true;}
^
TypeError: Object /dataset_description.json has no method 'startsWith'
at /home/praamana/node_modules/bids-validator/validators/bids.js:115:22
at Object.async.forEachOf.async.eachOf (/home/praamana/node_modules/bids-validator/node_modules/async/lib/async.js:233:13)
at Object.BIDS.fullTest (/home/praamana/node_modules/bids-validator/validators/bids.js:110:15)
at /home/praamana/node_modules/bids-validator/validators/bids.js:35:26
at Object.BIDS.quickTest (/home/praamana/node_modules/bids-validator/validators/bids.js:79:9)
at /home/praamana/node_modules/bids-validator/validators/bids.js:33:18
at Object.readDir (/home/praamana/node_modules/bids-validator/utils/files.js:89:9)
at Object.BIDS.start as BIDS
at module.exports (/home/praamana/node_modules/bids-validator/cli.js:12:18)
at Object. (/home/praamana/node_modules/bids-validator/bin/bids-validator:24:18)
$ 09:33:18 miner ~ >> /home/praamana/node_modules/.bin/bids-validator /sgehome/BIDS-examples/ds114_test2

/home/praamana/node_modules/bids-validator/validators/bids.js:115
if (path.startsWith('/sub-')) {hasSubjectDir = true;}
^
TypeError: Object /dataset_description.json has no method 'startsWith'
at /home/praamana/node_modules/bids-validator/validators/bids.js:115:22
at Object.async.forEachOf.async.eachOf (/home/praamana/node_modules/bids-validator/node_modules/async/lib/async.js:233:13)
at Object.BIDS.fullTest (/home/praamana/node_modules/bids-validator/validators/bids.js:110:15)
at /home/praamana/node_modules/bids-validator/validators/bids.js:35:26
at Object.BIDS.quickTest (/home/praamana/node_modules/bids-validator/validators/bids.js:79:9)
at /home/praamana/node_modules/bids-validator/validators/bids.js:33:18
at Object.readDir (/home/praamana/node_modules/bids-validator/utils/files.js:89:9)
at Object.BIDS.start as BIDS
at module.exports (/home/praamana/node_modules/bids-validator/cli.js:12:18)
at Object. (/home/praamana/node_modules/bids-validator/bin/bids-validator:24:18)
$ 09:33:24 miner ~ >> ls /sgehome/BIDS-examples/ds114_test?
/sgehome/BIDS-examples/ds114_test1:
dataset_description.json dwi.bval dwi.bvec out sub-01 sub-02 task-fingerfootlips_bold.json task-fingerfootlips_events.tsv task-linebisection_bold.json

/sgehome/BIDS-examples/ds114_test2:
dataset_description.json dwi.bval dwi.bvec out sub-01 sub-02 task-fingerfootlips_bold.json task-fingerfootlips_events.tsv task-linebisection_bold.json
$ 09:33:33 miner ~ >>

Validation is included now.