Skip to content

Commit

Permalink
fix(schema): Check SliceTiming length against SliceEncodingDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 9, 2024
1 parent 7aaad64 commit fb8d713
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/schema/rules/checks/mri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,27 @@ SliceTimingElements:
- modality == "mri"
- type(sidecar.SliceTiming) != "null"
- type(nifti_header) != "null"
- type(sidecar.SliceEncodingDirection) == 'null'
checks:
- length(sidecar.SliceTiming) == nifti_header.dim[3]

SliceTimingElementsWithDirection:
issue:
code: SLICETIMING_ELEMENTS
message: |
The number of elements in the 'SliceTiming' array should match the dimension
of the corresponding NIfTI volume matching `SliceEncodingDirection`
level: warning
selectors:
- modality == "mri"
- type(sidecar.SliceTiming) != "null"
- type(nifti_header) != "null"
- sidecar.SliceEncodingDirection
checks:
- sidecar.SliceEncodingDirection[0] != "i" || length(sidecar.SliceTiming) == nifti_header.dim[1]
- sidecar.SliceEncodingDirection[0] != "j" || length(sidecar.SliceTiming) == nifti_header.dim[2]
- sidecar.SliceEncodingDirection[0] != "k" || length(sidecar.SliceTiming) == nifti_header.dim[3]

# 93
EESGreaterThanTRT:
issue:
Expand Down

0 comments on commit fb8d713

Please sign in to comment.