Comments (6)
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.
from bids-matlab.
For the record, here is list of BIDS schemas or 'pseudo-schemas':
-
official YML based schema in the specification repo with some doc HERE
-
regex based rules of the BIDS-validator are in several JSON files here
-
pybids has some rules encoded in several json files HERE to help with folder and filename parsing.
-
matbids has equivalent ones HERE
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:
- who (which repo) is in charge of converting and hosting a json version of the schema?
- do we want to have an "interface" layer that is just in charge of reading the schema and passes its output to
bids.layout
or other functions? (Just thinking that this could be a way to keepbids.layout
insulated from any changes happening at the schema level (and could also help with testing).
from bids-matlab.
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 anat.yml
from the specs repo.
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 anat.json
.
[
{
"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"
}
}
]
from bids-matlab.
FYI: there is a kanban on the specs repo about anything scheme related.
https://github.com/bids-standard/bids-specification/projects/4
This includes a PR to cover derivatives in the schema.
bids-standard/bids-specification#645
from bids-matlab.
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.
from bids-matlab.
fixed by #124
from bids-matlab.
Related Issues (20)
- [BUG] Unexpexted warning during error report with missing `participants.json` on Windows HOT 7
- [ENH]: Incorporate json manipulation into bids.File class HOT 1
- improve error message when folder to index does not exist
- tsvwrite writes non-compliant tsvs when a table is provided HOT 1
- tsvwrite does not write datetimes in bids-compliant format
- TODO: check if tsvwrite can handle datetime data HOT 2
- improve bids.schema API HOT 1
- Test that bids model with nodes and edges in the wrong order
- inheritance principle bug: no more than one file per level allowed
- improve performance
- Resolve bids URI to full path when indexing explicit dependencies
- [ENH]: Retrieval of modality by bids.File HOT 3
- Update documentation
- [MAINT] last release was not published on zenodo HOT 1
- check if there is a way to speed up download of demo datasets
- do not throw warning when derivatives datasets are missing a participants.tsv
- [ENH]: `file.rename` could change `.` to `pt` in the case of `spec.entities.xxx = num2str(1.5)` HOT 1
- [BUG] bids.init adds a participant id with a duplicated sub entity prefix HOT 3
- [BUG] bids.init generated sessions file missing ses label from session_id column HOT 4
- rely on variable-transform spec for tests of transformers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bids-matlab.