diff --git a/src/schema/rules/sidecars/asl_validation.yaml b/src/schema/rules/sidecars/asl_validation.yaml new file mode 100644 index 0000000000..392b9bf7db --- /dev/null +++ b/src/schema/rules/sidecars/asl_validation.yaml @@ -0,0 +1,259 @@ +# Rules for ASL data that are not defined in tables. +--- + +# 157 +ASLLabelingDurationNiftiLength: + code: LABELING_DURATION_LENGTH_NOT_MATCHING_NIFTI + description: | + The number of values for 'LabelingDuration' for this file does not match the 4th dimension of the NIfTI header. + '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`, a scalar must be + specified. + In case the control-label volumes (or deltam or cbf) have a different `LabelingDuration`, + 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`. + level: error + selectors: + - suffix == "asl" + - sidecar contains "LabelingDuration" + - type(sidecar.LabelingDuration) == "array" + checks: + - nifti_header.dim[4] == len(sidecar.LabelingDuration) + +# 165 +ASLContextConsistent: + code: ASLCONTEXT_TSV_NOT_CONSISTENT + description: | + 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: + - suffix == "asl" + - associations contains "aslcontext" + checks: + - nifti_header.dim[4] == associations.aslcontext.n_rows + +# 168 +ASLFlipAngleNiftiLength: + code: FLIP_ANGLE_NOT_MATCHING_NIFTI + description: | + The number of values for 'FlipAngle' for this file does not match the 4th dimension of the NIfTI header. + '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, + or to the files in a file collection where the value of this field is iterated using the flip entity. + The data type array provides a value for each volume in a 4D dataset and should only be used when the + volume timing is critical for interpretation of the data, such as in ASL or variable flip angle fMRI sequences. + level: error + selectors: + - suffix == "asl" + - sidecar contains "FlipAngle" + - type(sidecar.FlipAngle) == "array" + checks: + - nifti_header.dim[4] == len(sidecar.FlipAngle) + +# 172 +ASLFlipAngleASLContextLength: + code: FLIP_ANGLE_NOT_MATCHING_ASLCONTEXT_TSV + description: | + The number of values for 'FlipAngle' for this file does not match the number of volumes in the + 'sub-