Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies authored Sep 13, 2023
2 parents 3d299fd + 18837af commit ca28036
Show file tree
Hide file tree
Showing 39 changed files with 204 additions and 223 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/schemacode_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
os: ["ubuntu-latest"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
python-version: 3
name: ${{ matrix.os }} with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Set up Python"
uses: actions/setup-python@v4
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
runs-on: ubuntu-latest
name: Validate schema
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Up Python environment
uses: actions/setup-python@v4
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
needs: [test, validate_schema]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@master

# Markdown formatting
remark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 14
Expand All @@ -36,7 +36,7 @@ jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
Expand All @@ -49,7 +49,7 @@ jobs:
python-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
Expand All @@ -63,7 +63,7 @@ jobs:
latin-phrases:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
Expand All @@ -86,7 +86,7 @@ jobs:
validate_cff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: check-added-large-files
- id: check-case-conflict
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
files: ^tools/(?!schemacode)
Expand All @@ -38,7 +38,7 @@ repos:
- id: flake8
args: [--config=tools/schemacode/setup.cfg]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v3.0.3
hooks:
- id: prettier
files: src/schema/.*/.*\.yaml
Expand All @@ -48,7 +48,7 @@ repos:
- id: codespell
args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.0
rev: v1.5.1
hooks:
- id: mypy
# Sync with project.optional-dependencies.typing
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Validation](https://github.com/bids-standard/bids-specification/actions/workflows/validation.yml/badge.svg)](https://github.com/bids-standard/bids-specification/actions/workflows/validation.yml)
[![CircleCI](https://circleci.com/gh/bids-standard/bids-specification.svg?style=shield)](https://circleci.com/gh/bids-standard/bids-specification)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109520103085644521?domain=https%3A%2F%2Ffosstodon.org%2F)](https://fosstodon.org/@bidsstandard)
[![@BIDSstandard](http://img.shields.io/twitter/follow/bidsstandard.svg?style=social)](https://twitter.com/BIDSstandard)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3686061.svg)](https://doi.org/10.5281/zenodo.3686061)

Expand Down
23 changes: 23 additions & 0 deletions src/common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,29 @@ Example:
}
```

Each level can be described with a string as in the example above,
or with an object containing the fields [`Description`](./glossary.md#description-metadata)
and [`TermURL`](./glossary.md#termurl-metadata)
like in the example below.

```JSON
{
"sex": {
"Description": "sex of the participant as reported by the participant",
"Levels": {
"M": {
"Description": "Male",
"TermURL": "https://www.ncbi.nlm.nih.gov/mesh/68008297"
},
"F": {
"Description": "Female",
"TermURL": "https://www.ncbi.nlm.nih.gov/mesh/68005260"
},
}
}
}
```

### Key-value files (dictionaries)

JavaScript Object Notation (JSON) files MUST be used for storing key-value
Expand Down
15 changes: 9 additions & 6 deletions src/modality-specific-files/magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,20 @@ which some installations impose to be run on raw data prior to analysis.
Such processing steps are needed for example because of active shielding software corrections
that have to be performed to before the MEG data can actually be exploited.

### Recording EEG simultaneously with MEG
### Recording (i)EEG simultaneously with MEG

Note that if EEG is recorded with a separate amplifier,
Note that if (i)EEG is recorded with a separate amplifier,
it SHOULD be stored separately under a new `/eeg` data type
(see [the EEG specification](electroencephalography.md)).
(see the [EEG](electroencephalography.md) and
[iEEG](intracranial-electroencephalography.md) specifications).

If however EEG is recorded simultaneously **with the same MEG system**,
If however (i)EEG is recorded simultaneously **with the same MEG system**,
it MAY be stored under the `/meg` data type.
In that case, it SHOULD have the same sampling frequency as MEG (see `SamplingFrequency` field below).
Furthermore, the EEG sensor coordinates SHOULD be specified using MEG-specific coordinate
systems (see [coordinates section](#coordinate-system-json-_coordsystemjson) below and
Furthermore, (i)EEG sensor coordinates MAY be recorded in an
[`electrodes.tsv`](electroencephalography.md#electrodes-description-_electrodestsv)
file using MEG-specific coordinate systems
(see [Coordinate System JSON](#coordinate-system-json-_coordsystemjson) below and
the [Coordinate Systems Appendix](../appendices/coordinate-systems.md)).

### Sidecar JSON (`*_meg.json`)
Expand Down
3 changes: 3 additions & 0 deletions src/schema/objects/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ age:
display_name: Subject age
description: |
Numeric value in years (float or integer value).
It is recommended to tag participant ages that are 89 or higher as 89+,
for privacy purposes.
type: number
unit: year
cardiac:
Expand Down
4 changes: 2 additions & 2 deletions src/schema/objects/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ part:
`part-real`/`part-imag` pairs of files.
Phase images MAY be in radians or in arbitrary units.
The sidecar JSON file MUST include the units of the `phase` image.
The sidecar JSON file MUST include the `"Units"` of the `phase` image.
The possible options are `"rad"` or `"arbitrary"`.
When there is only a magnitude image of a given type, the `part` entity MAY be
Expand Down Expand Up @@ -356,7 +356,7 @@ stain:
although the label may be different.
Descriptions of antibodies SHOULD also be indicated in the `"SamplePrimaryAntibodies"`
and/or `"SampleSecondaryAntobodies"` metadata fields, as appropriate.
and/or `"SampleSecondaryAntibodies"` metadata fields, as appropriate.
type: string
format: label
subject:
Expand Down
5 changes: 3 additions & 2 deletions src/schema/objects/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3365,9 +3365,10 @@ TermURL:
name: TermURL
display_name: TermURL
description: |
URL pointing to a formal definition of this type of data in an ontology
available on the web.
URL pointing to a formal definition of this type of data in an ontology available on the web.
For example: https://www.ncbi.nlm.nih.gov/mesh/68008297 for "male".
type: string
format: uri
TimeZero:
name: TimeZero
display_name: Time Zero
Expand Down
36 changes: 19 additions & 17 deletions src/schema/rules/checks/asl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ASLLabelingDurationNiftiLength:
an array of numbers must be specified, for which any `m0scan` in the timeseries has a `LabelingDuration` of
zero.
In case an array of numbers is provided, its length should be equal to the number of volumes specified in
`*_aslcontext.tsv`. Corresponds to DICOM Tag 0018,9258 `ASL Pulse Train Duration`.
the associated `aslcontext.tsv`. Corresponds to DICOM Tag 0018,9258 `ASL Pulse Train Duration`.
level: error
selectors:
- suffix == "asl"
Expand All @@ -30,7 +30,7 @@ ASLContextConsistent:
issue:
code: ASLCONTEXT_TSV_NOT_CONSISTENT
message: |
The number of volumes in the '*_aslcontext.tsv' for this file does not match the number of
The number of volumes in the 'aslcontext.tsv' for this file does not match the number of
values in the NIfTI header.
level: error
selectors:
Expand Down Expand Up @@ -68,7 +68,7 @@ ASLFlipAngleASLContextLength:
code: FLIP_ANGLE_NOT_MATCHING_ASLCONTEXT_TSV
message: |
The number of values for 'FlipAngle' for this file does not match the number of volumes in the
'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
associated 'aslcontext.tsv'.
'FlipAngle' is the flip angle (FA) for the acquisition, specified in degrees.
Corresponds to: DICOM Tag 0018, 1314 `Flip Angle`.
The data type number may apply to files from any MRI modality concerned with a single value for this field,
Expand Down Expand Up @@ -114,7 +114,7 @@ ASLPostLabelingDelayASLContextLength:
code: POST_LABELING_DELAY_NOT_MATCHING_ASLCONTEXT_TSV
message: |
The number of values for 'PostLabelingDelay' for this file does not match the number of volumes
in the 'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
in the associated 'aslcontext.tsv'.
'PostLabelingDelay' is the time, in seconds, after the end of the labeling (for (P)CASL) or
middle of the labeling pulse (for PASL) until the middle of the excitation pulse applied to
the imaging slab (for 3D acquisition) or first slice (for 2D acquisition).
Expand All @@ -138,7 +138,7 @@ ASLLabelingDurationASLContextLength:
code: LABELLING_DURATION_NOT_MATCHING_ASLCONTEXT_TSV
message: |
The number of values for 'LabelingDuration' for this file does not match the number of volumes
in the 'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
in the associated 'aslcontext.tsv'.
'LabelingDuration' is the total duration of the labeling pulse train, in seconds,
corresponding to the temporal width of the labeling bolus for `(P)CASL`.
In case all control-label volumes (or deltam or CBF) have the same `LabelingDuration`,
Expand All @@ -147,7 +147,7 @@ ASLLabelingDurationASLContextLength:
an array of numbers must be specified, for which any `m0scan` in the timeseries has a
`LabelingDuration` of zero.
In case an array of numbers is provided, its length should be equal to the number of volumes
specified in `*_aslcontext.tsv`.
specified in the associated `aslcontext.tsv`.
Corresponds to DICOM Tag 0018,9258 `ASL Pulse Train Duration`.
level: error
selectors:
Expand All @@ -163,7 +163,7 @@ ASLRepetitionTimePreparationASLContextLength:
code: REPETITIONTIMEPREPARATION_NOT_MATCHING_ASLCONTEXT_TSV
message: |
The number of values of 'RepetitionTimePreparation' for this file does not match the number of
volumes in the 'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
volumes in the associated 'aslcontext.tsv'.
'RepetitionTimePreparation' is the interval, in seconds, that it takes a preparation pulse block to
re-appear at the beginning of the succeeding (essentially identical) pulse sequence block.
The data type number may apply to files from any MRI modality concerned with a single value for this field.
Expand Down Expand Up @@ -201,9 +201,9 @@ ASLTotalAcquiredVolumesASLContextLength:
code: TOTAL_ACQUIRED_VOLUMES_NOT_CONSISTENT
message: |
The number of values for 'TotalAcquiredVolumes' for this file does not match number of
volumes in the 'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
volumes in the associated 'aslcontext.tsv'.
'TotalAcquiredVolumes' is the original number of 3D volumes acquired for each volume defined in the
'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
associated 'aslcontext.tsv'.
level: warning
selectors:
- suffix == "asl"
Expand All @@ -217,7 +217,7 @@ PostLabelingDelayGreater:
issue:
code: POST_LABELING_DELAY_GREATER
message: |
'PostLabelingDelay' is greater than 10, are you sure it's expressed in seconds?
'PostLabelingDelay' is greater than 10. Are you sure it's expressed in seconds?
level: warning
selectors:
- suffix == "asl"
Expand All @@ -230,7 +230,7 @@ BolusCutOffDelayTimeGreater:
issue:
code: BOLUS_CUT_OFF_DELAY_TIME_GREATER
message: |
'BolusCutOffDelayTime' is greater than 10, are you sure it's expressed in seconds?
'BolusCutOffDelayTime' is greater than 10. Are you sure it's expressed in seconds?
level: warning
selectors:
- sidecar.BolusCutOffDelayTime != null
Expand All @@ -242,7 +242,7 @@ LabelingDurationGreater:
issue:
code: LABELING_DURATION_GREATER
message: |
'LabelingDuration' is greater than 10, are you sure it's expressed in seconds?
'LabelingDuration' is greater than 10. Are you sure it's expressed in seconds?
level: warning
selectors:
- sidecar.LabelingDuration != null
Expand All @@ -255,7 +255,7 @@ ASLEchoTimeASLContextLength:
code: ECHO_TIME_NOT_CONSISTENT
message: |
The number of values for 'EchoTime' for this file does not match number of volumes in the
'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv'.
associated 'aslcontext.tsv'.
'EchoTime' is the echo time (TE) for the acquisition, specified in seconds.
level: warning
selectors:
Expand All @@ -272,8 +272,8 @@ ASLM0TypeAbsentScan:
issue:
code: M0Type_SET_INCORRECTLY_TO_ABSENT
message: |
You defined M0Type as 'absent' while including a separate '*_m0scan.nii[.gz]' and
'*_m0scan.json', or defining the 'M0Estimate' field.
You defined M0Type as 'absent' while including a separate 'm0scan.nii[.gz]' and
'm0scan.json', or defining the 'M0Estimate' field.
This is not allowed, please check that this field are filled correctly.
level: error
selectors:
Expand All @@ -289,7 +289,8 @@ ASLM0TypeAbsentASLContext:
issue:
code: M0Type_SET_INCORRECTLY_TO_ABSENT_IN_ASLCONTEXT
message: |
You defined M0Type as 'absent' while including an m0scan volume within the '*_aslcontext.tsv'.
You defined M0Type as 'absent' while including an m0scan volume within the associated
'aslcontext.tsv'.
This is not allowed, please check that this field are filled correctly.
level: error
selectors:
Expand All @@ -306,7 +307,8 @@ ASLM0TypeIncorrect:
code: M0Type_SET_INCORRECTLY
message: |
M0Type was not defined correctly.
If 'M0Type' is equal to 'separate', the dataset should include a *_m0scan.nii[.gz] and *_m0scan.json file.
If 'M0Type' is equal to 'separate', the dataset should include an associated
'm0scan.nii[.gz]' and 'm0scan.json' file.
level: error
selectors:
- suffix == "asl"
Expand Down
Loading

0 comments on commit ca28036

Please sign in to comment.