Skip to content

Commit 1dd81e0

Browse files
[Schema][Fix] add checks for multiple frame consistency issues (#2310)
* add checks for multiple frame consistency issues * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * keeping me honest yamllint * remove redundant selector || * remove redundant check --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9cfaafb commit 1dd81e0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

src/schema/rules/checks/pet.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
PETFrameConsistency:
55
issue:
66
code: PET_FRAME_CONSISTENCY
7+
message: |
8+
The number of frames as defined by FrameDuration and FrameTimesStart do not match in the
9+
associated '.json' file.
10+
level: error
11+
selectors:
12+
- suffix == 'pet'
13+
- sidecar.FrameDuration
14+
- sidecar.FrameTimesStart
15+
checks:
16+
- length(sidecar.FrameDuration) == length(sidecar.FrameTimesStart)
17+
18+
PETFrameConsistencyFrameDuration:
19+
issue:
20+
code: PET_FRAME_CONSISTENCY_FRAME_DURATION
721
message: |
822
The number of frames in this scan does not match the number of frames (as defined by FrameDuration) in the
923
associated '.json' file.
@@ -14,3 +28,17 @@ PETFrameConsistency:
1428
- sidecar.FrameDuration
1529
checks:
1630
- length(sidecar.FrameDuration) == nifti_header.dim[4]
31+
32+
PETFrameConsistencyFrameTimesStart:
33+
issue:
34+
code: PET_FRAME_CONSISTENCY_FRAME_TIMES_START
35+
message: |
36+
The number of frames in this scan does not match the number of frames (as defined by FrameTimesStart) in the
37+
associated '.json' file.
38+
level: error
39+
selectors:
40+
- suffix == 'pet'
41+
- type(nifti_header) != "null"
42+
- sidecar.FrameTimesStart
43+
checks:
44+
- length(sidecar.FrameTimesStart) == nifti_header.dim[4]

0 commit comments

Comments
 (0)