From 15469db6fa9e147cf97b1d98f0d8bf820b7f57b1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 20:42:41 -0500 Subject: [PATCH 1/3] fix(schema): Check for existence of stim_files in beh.tsv --- src/schema/rules/checks/events.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/rules/checks/events.yaml b/src/schema/rules/checks/events.yaml index 01d1a9537d..8d7fc4076d 100644 --- a/src/schema/rules/checks/events.yaml +++ b/src/schema/rules/checks/events.yaml @@ -26,7 +26,7 @@ StimulusFileMissing: A stimulus file was declared but not found in the dataset. level: error selectors: - - suffix == "events" + - intersects([suffix], ["events", "beh"]) - columns.stim_file != null checks: - exists(columns.stim_file, "stimuli") == length(columns.stim_file) - count(columns.stim_file, "n/a") From 7aaad6481f19f84257e404c00e3c1273cc693df8 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 20:44:17 -0500 Subject: [PATCH 2/3] fix(schema): Do not warn about missing events for task-noise --- src/schema/rules/checks/events.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/rules/checks/events.yaml b/src/schema/rules/checks/events.yaml index 8d7fc4076d..536423aec7 100644 --- a/src/schema/rules/checks/events.yaml +++ b/src/schema/rules/checks/events.yaml @@ -15,7 +15,7 @@ EventsMissing: - '!match(entities.task, "rest")' - '!intersects([suffix], ["events", "beh"])' - extension != ".json" - - (datatype != "meg" || entities.subject != "emptyroom") + - datatype != "meg" || entities.subject != "emptyroom" && entities.task != "noise" checks: - '"events" in associations' From fb8d7130dd70875af41583305886367a211f5c5f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 21:48:06 -0500 Subject: [PATCH 3/3] fix(schema): Check SliceTiming length against SliceEncodingDirection --- src/schema/rules/checks/mri.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/schema/rules/checks/mri.yaml b/src/schema/rules/checks/mri.yaml index 1aad6d7259..d2eeb001a8 100644 --- a/src/schema/rules/checks/mri.yaml +++ b/src/schema/rules/checks/mri.yaml @@ -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: