Skip to content
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

Add DatasetType="project" and rework existing "layout" example into a proper BIDS dataset #1861

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 47 additions & 43 deletions src/common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,49 +270,6 @@ However, in the case that these data are to be included:
We RECOMMEND including the PDF print-out with the actual sequence
parameters generated by the scanner in the `sourcedata` directory.

Alternatively one can organize their data in the following way

<!-- This block generates a file tree.
A guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_filetree_example(
{
"my_project-1": {
"sourcedata": {
"dicoms": {},
"raw": {
"sub-01": {},
"sub-02": {},
"...": "",
"dataset_description.json": "",
"...": "",
},
"..." : "",
},
"derivatives": {
"pipeline_1": {},
"pipeline_2": {},
"...": "",
}
}
}
) }}

In this example, `sourcedata/dicoms` is not nested inside
`sourcedata/raw`, **and only the `sourcedata/raw` subdirectory** is a BIDS-compliant dataset among `sourcedata/` subfolders.
The subdirectories of `derivatives` MAY be BIDS-compliant derivatives datasets
(see [Non-compliant derivatives](#non-compliant-derivatives) for further discussion).
The above example is just a convention useful for organizing source, raw BIDS, and derived BIDS data while maintaining BIDS compliance of the raw data directory.
When using this convention it is RECOMMENDED to set the `SourceDatasets`
field in `dataset_description.json` of each subdirectory of `derivatives` to:

```JSON
{
"SourceDatasets": [ {"URL": "../../sourcedata/raw/"} ]
}
```

!!! danger "Caution"

Sharing source data may help amend errors and missing data discovered
Expand Down Expand Up @@ -436,6 +393,53 @@ In particular, if a BIDS dataset contains a `derivatives/` subdirectory,
the contents of that directory may be a heterogeneous mix of BIDS Derivatives
datasets and non-compliant derivatives.

## Project dataset

BIDS allows one to organize the data for the entire project (original source data, raw BIDS, derivatives) as a valid BIDS dataset in the following way

<!-- This block generates a file tree.
A guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_filetree_example(
{
"my_project-1": {
"sourcedata": {
"dicoms": {},
"raw": {
"sub-01": {},
"sub-02": {},
"...": "",
"dataset_description.json": "",
"...": "",
},
"..." : "",
},
"derivatives": {
"pipeline_1": {},
"pipeline_2": {},
"...": "",
},
"dataset_description.json": "",
"...": "",
}
}
) }}

In this example, `sourcedata/dicoms` is not nested inside
`sourcedata/raw`, **and only the `sourcedata/raw` subdirectory** is a BIDS-compliant dataset among `sourcedata/` subfolders.
The subdirectories of `derivatives` MAY be BIDS-compliant derivatives datasets
(see [Non-compliant derivatives](#non-compliant-derivatives) for further discussion).
The above example is a fully compliant BIDS dataset, providing a convention useful for organizing source, raw BIDS, and derived BIDS data while maintaining overall BIDS compliance.
When using this convention, `dataset_description.json` MUST have `DatasetType` to be set to `"project"`. It is also RECOMMENDED to set the `SourceDatasets`
field in `dataset_description.json` of each subdirectory of `derivatives` to:

```JSON
{
"SourceDatasets": [ {"URL": "../../sourcedata/raw/"} ]
yarikoptic marked this conversation as resolved.
Show resolved Hide resolved
}
```

## File format specification

### Imaging files
Expand Down
5 changes: 5 additions & 0 deletions src/schema/objects/enums.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ derivative:
display_name: derivative
description: |
A derived BIDS dataset.
project:
value: project
display_name: project
description: |
A project BIDS dataset.
balanced:
value: balanced
display_name: balanced
Expand Down
1 change: 1 addition & 0 deletions src/schema/objects/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ DatasetType:
enum:
- $ref: objects.enums.raw.value
- $ref: objects.enums.derivative.value
- $ref: objects.enums.project.value
DecayCorrectionFactor:
name: DecayCorrectionFactor
display_name: Decay Correction Factor
Expand Down
3 changes: 2 additions & 1 deletion src/schema/rules/checks/dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ SubjectFolders:
issue:
code: SUBJECT_FOLDERS
message: |
There are no subject directories (labeled "sub-*") in the root of this dataset.
There are no subject directories (labeled "sub-*") in the root of this raw BIDS dataset.
level: error
selectors:
- path == '/dataset_description.json'
- dataset.dataset_description.DatasetType == "raw"
checks:
- length(dataset.subjects.sub_dirs) > 0

Expand Down