-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using the BIDS-schema to simplify creating the dataset layout #76
Comments
matbids already has the BIDS scheme apart from the implementation. It is a one-on-one port from the (older) pybids implementation and uses json files. A suggestion is to maybe use the bids-validator json files. |
For the record, here is list of BIDS schemas or 'pseudo-schemas':
From my understanding and seeing that other tools will progressively try to rely only on the BIDS official schema, I think it makes sense to alreay start moving in that direction. Question:
|
On converting the schema. This can be done fairly simply with the python package ruamel Virtual env (because everything is better with a virtual env) virtualenv -p python3 convert_schema
source convert_schema/bin/activate
pip install ruamel.yaml Example to convert the from ruamel.yaml import YAML
import json
in_file = 'src/schema/datatypes/anat.yaml'
out_file = 'anat.json'
yaml = YAML(typ='safe')
with open(in_file) as fpi:
data = yaml.load(fpi)
with open(out_file, 'w') as fpo:
json.dump(data, fpo, indent=2) Gives the following content for [
{
"suffixes": [
"T1w",
"T2w",
"T1rho",
"T1map",
"T2map",
"T2star",
"FLAIR",
"FLASH",
"PD",
"PDmap",
"PDT2",
"inplaneT1",
"inplaneT2",
"angio"
],
"extensions": [
".nii.gz",
".nii",
".json"
],
"entities": {
"sub": "required",
"ses": "optional",
"run": "optional",
"acq": "optional",
"ce": "optional",
"rec": "optional"
}
},
{
"suffixes": [
"defacemask"
],
"extensions": [
".nii.gz",
".nii",
".json"
],
"entities": {
"sub": "required",
"ses": "optional",
"run": "optional",
"acq": "optional",
"ce": "optional",
"rec": "optional",
"mod": "optional"
}
}
] |
FYI: there is a kanban on the specs repo about anything scheme related. This includes a PR to cover derivatives in the schema. |
One issue that is not addressed by this though is how do we deal with things that are in the BIDS-BEP pipeline but not yet in the schema. For example I have to deal with MP2RAGE images that are in BEP001 but not yet in the schema. Do we want to a sort of "fall back" solution when we are dealing with a dataset that is not "vanilla BIDS". Should we then rely on a JSON file to define "patterns" to deal with those cases a bit like pybids does at the moment for the regular stuff. |
fixed by #124 |
This would rely on using the BIDS schema that exists as a set of
yml
files for now and should therefore be converted to something that matlab can handle like JSON.Questions
See other comments in the "wish-list" issue #60
#60 (comment)
#60 (comment)
#60 (comment)
#60 (comment)
#60 (comment)
The text was updated successfully, but these errors were encountered: