diff --git a/README.md b/README.md index bfafa682c1785f5c837ae5b53d92f6376a401418..83f42cec793e2f1dd40f8a7a5c5218ab7cfa490c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,33 @@ that can read folder structures that comply with the Please read the [README_SETUP.md](README_SETUP.md) for instructions on how to setup this code. +## Design +The BIDS Standard defines rules for how data is stored in files and how those +(and directories) must be named. Those rules can be checked with the +`bids-validator`. The current implementation of this cfood and the corresponding +[converter](https://gitlab.indiscale.com/caosdb/src/crawler-converters/bids-converter) +does the following: +- the `dataset_description.json` is parsed and translated to CaosDB Entities +- the key value pairs of folder and file names (e.g. "sub-<sub-label>") are + parsed and the stored in appropriate Records +- the contents of measurement folders such as 'eeg', 'func' or 'anat' are + assigned to DataAcquisition Records. Each Record shall reference the full + information for the acquisition. Thus files are typically grouped according + to their values of the 'acq', 'run', and possibly 'task' keys. If files + correspond to multiple acquisitions (the filename is missing some key value + pairs), then those files are referenced by all corresponding Records. This + grouping is done by the BIDS<datatype>DirConverter classes of the + bids-converter. +- Based on the suffix of files parents for files are selected. +- The data model references the corresponding BIDS documentation in the + description where appropriate. +- The session folder may be omitted in BIDS. The crawler always creates at least + one session. See BIDSSubjectDirConverter classes of the bids-converter. + + +## Notes +- Currently the folders `sourcedata` and `derivates` are being ignored. +- Currently parametric maps are ignored (ANAT) ## Further Reading diff --git a/README_SETUP.md b/README_SETUP.md index 222dcee211cf49f6d1d7e5b8f283eb7f5ad98b0a..f8228272a0f7f1290f01338e08a455d61fcecf67 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -14,13 +14,17 @@ After you started a server that mounts the test data (possibly use `test-profile you can run `pytest `integrationtests`. ### Manual Tests -You can crawl examples from the `bids-examples` submodule: +You can crawl examples from the `bids-examples` submodule. The follwing shows it for the `eeg_matchingpennies` data set: ```sh +# all commands are assumed to be run from the bids-cfood folder # add the model python -m caosadvancedtools.models.parser src/bids-cfood/model.yml --sync # insert files python -m caosadvancedtools.loadFiles -p /examples /opt/caosdb/mnt/extroot/examples/eeg_matchingpennies +# run crawler +caosdb-crawler --debug -s update -i src/bids-cfood/identifiables.yml --remove-prefix /bids-examples --add-prefix /examples src/bids-cfood/cfood.yml bids-examples/eeg_matchingpennies ``` + ## Usage You will need to copy (parts of) the cfood definition `./src/bids-cfood/cfood.yml` into your cfood. @@ -28,4 +32,3 @@ into your cfood. -sourcedata and derivates are being ignored. diff --git a/src/bids-cfood/cfood.yml b/src/bids-cfood/cfood.yml index 75c963e76a70e37bdd2e529be51e95ff5ed205be..a816455fa607470e7649a36bb5a35821b2cc4eb4 100644 --- a/src/bids-cfood/cfood.yml +++ b/src/bids-cfood/cfood.yml @@ -531,7 +531,7 @@ project_level: parent: "ElectrodeFile" - suffix: "photo" parent: "PhotoFile" - fmap: + fmap: type: BIDSFMAPDirectory match: ^(?P<datatype>fmap)$ subtree: