bids-validator
bids-validator copied to clipboard
Options to treat presence of modalities as an error
Databases may use the validator to determine whether to accept a dataset, a practice notably employed by OpenNeuro to keep a low-overhead submission process. With the expansion into new modalities, it may be useful for a database to accept/reject entire modalities to ensure that the data being uploaded fits the intended scope and capabilities of the database.
Critically, the rejection mechanism must not be bypassable via .bidsignore
.
Related: #844.
From meeting today, can at least issue error after this step in validation if an unacceptable modality is found: https://github.com/bids-standard/bids-validator/blob/c1c961599b086fdacf61cbc2327b35e8002f9bc3/bids-validator/validators/bids/fullTest.js#L46
added in #1418 but I realize now is still bypassable by bidsignore, ignored files are filtered out before the collectModality call is made inside of collectSummary.
Files in .bidsignore are getting culled even earlier that fullTest it looks like, printing length of Object.keys(fileList) does not change before or after collectSummary call, or even after a further down loop in fullTest where files with an ignore property are being removed from fileList.
Forgot about this, ignored files are treated differently in node and in the browser. In node ignored files are never pushed to the fileList where as browser files get an ignore
key set to tree added to their file object. This happens in utils/files/readDir.
Forgot about this, ignored files are treated differently in node and in the browser. In node ignored files are never pushed to the fileList where as browser files get an
ignore
key set to tree added to their file object. This happens in utils/files/readDir.
They also get removed again here. Node should probably just also set ignore
, then let this step clean them up after anything that needs to consider the ignored files has been tested.
https://github.com/bids-standard/bids-validator/blob/a755f65740fab23648415701c8f07d9633fca525/bids-validator/validators/bids/fullTest.js#L72-L77
Is that redundant with this being run before it?: https://github.com/bids-standard/bids-validator/blob/a755f65740fab23648415701c8f07d9633fca525/bids-validator/utils/summary/collectSummary.js#L24-L29
I'll make a new PR to have node treat ignored files the same as browser, and fix the modality blacklist check.