Skip to content

Commit

Permalink
Merge pull request #1063 from bendhouseart/schema-sprint
Browse files Browse the repository at this point in the history
[SCHEMA] Correlating existing validator issues to schema entries
  • Loading branch information
effigies authored Apr 14, 2022
2 parents b3dbb44 + c054ae5 commit a022462
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 7 deletions.
85 changes: 79 additions & 6 deletions src/schema/rules/sidecars/asl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,24 @@ MRIASLTextOnlySliceTiming:
- suffix == "asl"
- sidecar.MRAcquisitionType == "2D"
fields:
SliceTiming: REQUIRED
SliceTiming:
level: REQUIRED
issue:
name: SLICE_TIMING_NOT_DEFINED_2D_ASL
message: |
"You should define SliceTiming', in case 'SequenceType' is set to a
2D sequence. 'SliceTiming' is the time at which each slice was
acquired within each volume (frame) of the acquisition. Slice timing
is not slice order -- rather, it is a list of times containing the
time (in seconds) of each slice acquisition in relation to the beginning
of volume acquisition. The list goes through the slices along the slice
axis in the slice encoding dimension (see below). Note that to ensure the
proper interpretation of the `SliceTiming` field, it is important to check
if the OPTIONAL `SliceEncodingDirection` exists. In particular, if
`SliceEncodingDirection` is negative, the entries in `SliceTiming` are
defined in reverse order with respect to the slice axis, such that the
final entry in the `SliceTiming` list is the time of acquisition of slice 0.
Without this parameter slice time correction will not be possible."
MRIASLTextOnlyFlipAngle:
selectors:
Expand All @@ -40,7 +57,22 @@ MRIASLTextOnlyFlipAngle:
- suffix == "asl"
- sidecar.LookLocker == true
fields:
FlipAngle: REQUIRED
FlipAngle:
level: REQUIRED
issue:
name: LOOK_LOCKER_FLIP_ANGLE_MISSING
message: |
"You should define 'FlipAngle' for this file, in case of a
LookLocker acquisition. '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."
# Common metadata fields applicable to both (P)CASL and PASL
MRIASLCommonMetadataFields:
Expand Down Expand Up @@ -81,7 +113,14 @@ MRIASLCommonMetadataFieldsM0Type:
- suffix == "asl"
- sidecar.M0Type == "Estimate"
fields:
M0Estimate: REQUIRED
M0Estimate:
level: REQUIRED
issue:
name: M0ESTIMATE_NOT_DEFINED
message: |
You must define 'M0Estimate' for this file, in case 'M0Type' is defined as 'Estimate'.
'M0Estimate' is a single numerical whole-brain M0 value (referring to the M0 of blood),
only if obtained externally (for example retrieved from CSF in a separate measurement).
MRIASLCommonMetadataFieldsBackgroundSuppression:
selectors:
Expand Down Expand Up @@ -160,8 +199,29 @@ MRIASLPASLSpecificBolusCutOffFlag:
- sidecar.ArterialSpinLabelingType == "PASL"
- sidecar.BolusCutOffFlag == true
fields:
BolusCutOffDelayTime: REQUIRED
BolusCutOffTechnique: REQUIRED
BolusCutOffDelayTime:
level: REQUIRED
issue:
name: PASL_BOLUS_CUT_OFF_DELAY_TIME
message: |
It is required to define 'BolusCutOffDelayTime' for this file,
when 'BolusCutOffFlag' is set to true. 'BolusCutOffDelayTime' is
the duration between the end of the labeling and the start of the
bolus cut-off saturation pulse(s), in seconds. This can be a number
or array of numbers, of which the values must be non-negative and
monotonically increasing, depending on the number of bolus cut-off
saturation pulses. For Q2TIPS, only the values for the first and last
bolus cut-off saturation pulses are provided. Based on DICOM Tag
0018,925F ASL Bolus Cut-off Delay Time.
BolusCutOffTechnique:
level: REQUIRED
issue:
name: PASL_BOLUS_CUT_OFF_TECHINIQUE
message: |
It is required to define 'BolusCutOffTechnique' for this file,
when 'BolusCutOffFlag' is set to true. 'BolusCutOffTechnique',
is the name of the technique used (e.g. Q2TIPS, QUIPSS, QUIPSSII).
Corresponds to DICOM Tag 0018,925E ASL Bolus Cut-off Technique.
# m0scan metadata fields
MRIASLM0ScanTextOnly:
Expand All @@ -183,7 +243,20 @@ MRIASLM0ScanTextOnlyFlipAngle:
- suffix == "m0scan"
- sidecar.LookLocker == true
fields:
FlipAngle: REQUIRED
FlipAngle:
level: REQUIRED
issue:
name: LOOK_LOCKER_FLIP_ANGLE_MISSING
message: |
You should define 'FlipAngle' for this file, in case of a LookLocker
acquisition. '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.
MRIASLM0Scan:
selectors:
Expand Down
2 changes: 1 addition & 1 deletion src/schema/rules/sidecars/eeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ EEGRequired:
The sampling frequency of data channels that deviate from the main sampling
frequency SHOULD be specified in the `channels.tsv` file.
PowerLineFrequency: REQUIRED
SoftwareFilters": REQUIRED
SoftwareFilters: REQUIRED

EEGMoreRecommended:
selectors:
Expand Down
4 changes: 4 additions & 0 deletions src/schema/rules/sidecars/func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ MRIFuncTimingParameters:
REQUIRED for sequences that are described with the `VolumeTiming`
field and that do not have the `SliceTiming` field set to allow for
accurate calculation of "acquisition time"
issue:
name: VOLUME_TIMING_MISSING_ACQUISITION_DURATION
message: |
The field 'VolumeTiming' requires 'AcquisitionDuration' or 'SliceTiming' to be defined.
DelayAfterTrigger: RECOMMENDED

# The mutual exclusion table, spread across 5 definitions
Expand Down
39 changes: 39 additions & 0 deletions src/schema/rules/sidecars/mri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,31 @@ MRISpatialEncoding:
This parameter is REQUIRED if corresponding fieldmap data is present
or when using multiple runs with different phase encoding directions
(which can be later used for field inhomogeneity correction).
issue:
name: PHASE_ENCODING_DIRECTION_MUST_DEFINE
issue: |
You have to define 'PhaseEncodingDirection' for this file.
EffectiveEchoSpacing:
level: RECOMMENDED
level_addendum: |
<sup>2</sup> This parameter is REQUIRED if corresponding fieldmap data
is present.
issue:
name: EFFECTIVE_ECHO_SPACING_NOT_DEFINED
message: |
You should define 'EffectiveEchoSpacing' for this file. If you don't
provide this information field map correction will not be possible.
TotalReadoutTime:
level: RECOMMENDED
level_addendum: |
<sup>3</sup> This parameter is REQUIRED if corresponding 'field/distortion' maps
acquired with opposing phase encoding directions are present
(see [Case 4: Multiple phase encoded
directions](#case-4-multiple-phase-encoded-directions-pepolar)).
issue:
name: TOTAL_READOUT_TIME_MUST_DEFINE
message: |
You have to define 'TotalReadoutTime' for this file.
MixingTime: RECOMMENDED

MRITimingParameters:
Expand All @@ -142,6 +155,18 @@ MRITimingParameters:
level_addendum: |
REQUIRED if corresponding fieldmap data is present,
or the data comes from a multi-echo sequence or Arterial Spin Labeling.
issue:
name: ECHO_TIME_NOT_DEFINED
message: |
You must define 'EchoTime' for this file. 'EchoTime' is the echo time (TE)
for the acquisition, specified in seconds. Corresponds to DICOM Tag
0018, 0081 Echo Time (please note that the DICOM term is in milliseconds
not seconds). 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 echo 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 echo time fMRI sequences.
InversionTime: RECOMMENDED
SliceTiming:
level: RECOMMENDED
Expand Down Expand Up @@ -175,6 +200,20 @@ MRIRFandContrast:
FlipAngle:
level: RECOMMENDED
level_addendum: REQUIRED if LookLocker is set to `true`.
issue:
name: LOOK_LOCKER_FLIP_ANGLE_MISSING
message: |
You should define 'FlipAngle' for this file, in
case of a LookLocker acquisition. '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.
NegativeContrast: OPTIONAL

MRIFlipAngleLookLocker:
Expand Down

0 comments on commit a022462

Please sign in to comment.