Skip to content

Commit

Permalink
Merge pull request #1 from bids-standard/bep022
Browse files Browse the repository at this point in the history
Bep022
  • Loading branch information
markmikkelsen authored Sep 7, 2023
2 parents 96da97d + 3f83bdc commit 08201f1
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 199 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
- id: flake8
args: [--config=tools/schemacode/setup.cfg]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v3.0.3
hooks:
- id: prettier
files: src/schema/.*/.*\.yaml
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
2 changes: 1 addition & 1 deletion src/schema/objects/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,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
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
13 changes: 7 additions & 6 deletions src/schema/rules/checks/dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SamplesTSVMissing:
issue:
code: SAMPLES_TSV_MISSING
message: |
The compulsory file /samples.tsv is missing. See Modality agnostic files section of the BIDS specification.
The compulsory file '/samples.tsv' is missing.
See 'Modality agnostic files' section of the BIDS specification.
level: error
selectors:
- path == 'dataset_description.json'
Expand All @@ -55,7 +56,7 @@ UnknownVersion:
issue:
code: UNKNOWN_BIDS_VERSION
message: |
The BIDSVersion field of dataset_description.json does not match a known release.
The BIDSVersion field of 'dataset_description.json' does not match a known release.
The BIDS Schema used for validation may be out of date.
level: warning
selectors:
Expand All @@ -68,7 +69,7 @@ SingleSourceAuthors:
code: AUTHORS_AND_CITATION_FILE_MUTUALLY_EXCLUSIVE
level: error
message: |
CITATION.cff file found. The "Authors" field of dataset_description.json
'CITATION.cff' file found. The "Authors" field of 'dataset_description.json'
must be removed to avoid inconsistency.
selectors:
- path == 'CITATION.cff'
Expand All @@ -80,9 +81,9 @@ SingleSourceCitationFields:
code: SINGLE_SOURCE_CITATION_FIELDS
level: warning
message: |
CITATION.cff file found. The "HowToAckowledge", "License",
and "ReferencesAndLinks" fields of dataset_description.json
should be removed to avoid inconsistency.
CITATION.cff file found.
The "HowToAckowledge", "License", and "ReferencesAndLinks" fields of
'dataset_description.json' should be removed to avoid inconsistency.
selectors:
- path == 'CITATION.cff'
checks:
Expand Down
10 changes: 5 additions & 5 deletions src/schema/rules/checks/dwi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DWIVolumeCount:
code: VOLUME_COUNT_MISMATCH
message: |
The number of volumes in this scan does not match the number of volumes in the
corresponding .bvec and .bval files.
associated '.bvec' and '.bval' files.
level: error
selectors:
- suffix == "dwi"
Expand All @@ -22,7 +22,7 @@ DWIBvalRows:
issue:
code: BVAL_MULTIPLE_ROWS
message: |
'.bval' files should contain exactly one row of volumes.
'.bval' files should contain exactly one row of values.
level: error
selectors:
- extension == ".bval"
Expand All @@ -34,7 +34,7 @@ DWIBvecRows:
issue:
code: BVEC_NUMBER_ROWS
message: |
'.bvec' files should contain exactly three rows of volumes.
'.bvec' files should contain exactly three rows of values.
level: error
selectors:
- extension == ".bvec"
Expand All @@ -46,7 +46,7 @@ DWIMissingBvec:
issue:
code: DWI_MISSING_BVEC
message: |
DWI scans must have a corresponding .bvec file.
DWI scans must have a corresponding '.bvec' file.
level: error
selectors:
- suffix == "dwi"
Expand All @@ -59,7 +59,7 @@ DWIMissingBval:
issue:
code: DWI_MISSING_BVAL
message: |
DWI scans must have a corresponding .bval file.
DWI scans must have a corresponding '.bval' file.
level: error
selectors:
- suffix == "dwi"
Expand Down
2 changes: 1 addition & 1 deletion src/schema/rules/checks/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EventsMissing:
issue:
code: EVENTS_TSV_MISSING
message: |
Task scans should have a corresponding events.tsv file.
Task scans should have a corresponding 'events.tsv' file.
If this is a resting state scan you can ignore this warning or rename the task to include the word "rest".
level: warning # could be an error with the proper selectors, I think
selectors:
Expand Down
6 changes: 3 additions & 3 deletions src/schema/rules/checks/fmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FmapFieldmapWithoutMagnitude:
issue:
code: FIELDMAP_WITHOUT_MAGNITUDE_FILE
message: |
'_fieldmap.nii[.gz]' file does not have accompanying '_magnitude.nii[.gz]' file.
'fieldmap.nii[.gz]' file does not have an associated 'magnitude.nii[.gz]' file.
level: error
selectors:
- suffix == "fieldmap"
Expand All @@ -30,7 +30,7 @@ FmapPhasediffWithoutMagnitude:
issue:
code: MISSING_MAGNITUDE1_FILE
message: |
Each '_phasediff.nii[.gz]' file should be associations with a '_magnitude1.nii[.gz]' file.
'phasediff.nii[.gz]' file does not have an associated 'magnitude1.nii[.gz]' file.
level: warning
selectors:
- suffix == "phasediff"
Expand All @@ -42,7 +42,7 @@ MagnitudeFileWithTooManyDimensions:
issue:
code: MAGNITUDE_FILE_WITH_TOO_MANY_DIMENSIONS
message: |
_magnitude1.nii[.gz] and _magnitude2.nii[.gz] files must have exactly three dimensions.
'magnitude1.nii[.gz]' and 'magnitude2.nii[.gz]' files must have exactly three dimensions.
level: error
selectors:
- intersects([suffix], ['magnitude1', 'magnitude2'])
Expand Down
16 changes: 8 additions & 8 deletions src/schema/rules/checks/func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ PhaseSuffixDeprecated:
code: PHASE_SUFFIX_DEPRECATED
message: |
DEPRECATED. Phase information associated with magnitude information stored in BOLD contrast.
This suffix should be replaced by the part-phase in conjunction with the bold suffix.
For backwards compatibility, _phase is considered equivalent to _part-phase_bold.
When the _phase suffix is not used, each file shares the same name with the exception of the
part-<mag|phase> or part-<real|imag> key/value.
This suffix should be replaced by the 'part-phase' entity in conjunction with the 'bold' suffix.
For backwards compatibility, 'phase' is considered equivalent to 'part-phase_bold'.
When the 'phase' suffix is not used, each file shares the same name with the exception of the
'part-<mag|phase>' or 'part-<real|imag>' key/value.
level: warning
selectors:
- datatype == "func"
Expand All @@ -20,7 +20,7 @@ RepetitionTimeGreaterThan:
issue:
code: REPETITION_TIME_GREATER_THAN
message: |
'RepetitionTime' is greater than 100 are you sure it's expressed in seconds?
'RepetitionTime' is greater than 100. Are you sure it's expressed in seconds?
level: warning
selectors:
- suffix == "bold"
Expand All @@ -47,7 +47,7 @@ BoldNot4d:
issue:
code: BOLD_NOT_4D
message: |
Bold scans must be 4 dimensional.
BOLD scans must be 4 dimensional.
level: error
selectors:
- suffix == "bold"
Expand All @@ -60,8 +60,8 @@ SliceTimingGreaterThanRepetitionTime:
issue:
code: SLICETIMING_VALUES_GREATER_THAN_REPETITION_TIME
message: |
SliceTiming values contains invalid value as it is greater than RepetitionTime.
SliceTiming values should be in seconds not milliseconds (common mistake).
'SliceTiming' contains invalid value(s) greater than 'RepetitionTime'.
'SliceTiming' values should be in seconds, not milliseconds (common mistake).
level: error
selectors:
- suffix == "bold"
Expand Down
6 changes: 3 additions & 3 deletions src/schema/rules/checks/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DuplicateFiles:
issue:
code: DUPLICATE_FILES
message: |
File exists with and without `.gz` extension
File exists with and without `.gz` extension.
level: error
selectors:
- match(extension, '\.gz$')
Expand All @@ -16,8 +16,8 @@ ReadmeFileSmall:
issue:
code: README_FILE_SMALL
message: |
The recommended file /README is very small. Please consider expanding it
with additional information about the dataset.
The recommended file '/README' is very small.
Please consider expanding it with additional information about the dataset.
level: warning
selectors:
- match(path, '^README')
Expand Down
7 changes: 4 additions & 3 deletions src/schema/rules/checks/hints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ TooFewAuthors:
issue:
code: TOO_FEW_AUTHORS
message: |
The Authors field of dataset_description.json should contain an array of fields -
with one author per field. This was triggered based on the presence of only one
author field. Please ignore if all contributors are already properly listed.
The 'Authors' field of 'dataset_description.json' should contain an array of values -
with one author per value.
This was triggered based on the presence of only one author field.
Please ignore if all contributors are already properly listed.
level: warning
selectors:
- path == '/dataset_description.json'
Expand Down
3 changes: 2 additions & 1 deletion src/schema/rules/checks/micr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ PixelSizeInconsistent:
issue:
code: PIXEL_SIZE_INCONSISTENT
message: |
PixelSize need to be consistent with PhysicalSizeX, PhysicalSizeY and PhysicalSizeZ OME metadata fields
'PixelSize' need to be consistent with the 'PhysicalSizeX', 'PhysicalSizeY' and 'PhysicalSizeZ'
OME metadata fields.
level: error
selectors:
- ome != null
Expand Down
Loading

0 comments on commit 08201f1

Please sign in to comment.