From f9799310fb344be88a3b7b415f0ab97d7f8d4515 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 19 Aug 2024 15:39:36 -0400 Subject: [PATCH 1/4] feat(schema): Move coordsystem.json rules out of rules.sidecars --- src/schema/rules/json/eeg.yaml | 91 ++++++++++++++++++ src/schema/rules/json/ieeg.yaml | 50 ++++++++++ src/schema/rules/json/meg.yaml | 141 ++++++++++++++++++++++++++++ src/schema/rules/json/nirs.yaml | 93 ++++++++++++++++++ src/schema/rules/sidecars/eeg.yaml | 85 ----------------- src/schema/rules/sidecars/ieeg.yaml | 44 --------- src/schema/rules/sidecars/meg.yaml | 136 --------------------------- src/schema/rules/sidecars/nirs.yaml | 93 ------------------ 8 files changed, 375 insertions(+), 358 deletions(-) create mode 100644 src/schema/rules/json/eeg.yaml create mode 100644 src/schema/rules/json/ieeg.yaml create mode 100644 src/schema/rules/json/meg.yaml create mode 100644 src/schema/rules/json/nirs.yaml diff --git a/src/schema/rules/json/eeg.yaml b/src/schema/rules/json/eeg.yaml new file mode 100644 index 0000000000..f42956671f --- /dev/null +++ b/src/schema/rules/json/eeg.yaml @@ -0,0 +1,91 @@ +# +# Groups of related metadata fields +# +# Assumptions: never need disjunction of selectors +# Assumptions: top-to-bottom overrides is sufficient logic + +--- +# General fields +EEGCoordsystemGeneral: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + fields: + IntendedFor: + level: optional + description_addendum: | + This identifies the MRI or CT scan associated with the electrodes, + landmarks, and fiducials. + +# Fields relating to the EEG electrode positions +EEGCoordsystemPositions: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + fields: + EEGCoordinateSystem: required + EEGCoordinateUnits: required + EEGCoordinateSystemDescription: + level: recommended + level_addendum: required if `EEGCoordinateSystem` is `"Other"` + +EEGCoordsystemOther: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + - '"EEGCoordinateSystem" in json' + - json.EEGCoordinateSystem == "Other" + fields: + EEGCoordinateSystemDescription: required + +# Fields relating to the position of fiducials measured during an EEG session/run +EEGCoordsystemFiducials: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + fields: + FiducialsDescription: optional + FiducialsCoordinates: recommended + FiducialsCoordinateSystem: recommended + FiducialsCoordinateUnits: recommended + FiducialsCoordinateSystemDescription: + level: recommended + level_addendum: required if `FiducialsCoordinateSystem` is `"Other"` + +EEGCoordsystemOtherFiducialCoordinateSystem: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + - json.FiducialsCoordinateSystem == "Other" + fields: + FiducialsCoordinateSystemDescription: required + +# Fields relating to the position of anatomical landmark measured during an EEG session/run +EEGCoordsystemLandmark: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + fields: + AnatomicalLandmarkCoordinates: recommended + AnatomicalLandmarkCoordinateSystem: + level: recommended + description_addendum: Preferably the same as the `EEGCoordinateSystem`. + AnatomicalLandmarkCoordinateUnits: recommended + +EEGCoordsystemLandmarkDescriptionRec: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + - json.AnatomicalLandmarkCoordinateSystem != "Other" + fields: + AnatomicalLandmarkCoordinateSystemDescription: + level: recommended + level_addendum: required if `AnatomicalLandmarkCoordinateSystem` is `"Other"` + +EEGCoordsystemLandmarkDescriptionReq: + selectors: + - datatype == "eeg" + - suffix == "coordsystem" + - json.AnatomicalLandmarkCoordinateSystem == "Other" + fields: + AnatomicalLandmarkCoordinateSystemDescription: required diff --git a/src/schema/rules/json/ieeg.yaml b/src/schema/rules/json/ieeg.yaml new file mode 100644 index 0000000000..4271cfe952 --- /dev/null +++ b/src/schema/rules/json/ieeg.yaml @@ -0,0 +1,50 @@ +# +# Groups of related metadata fields +# +# Assumptions: never need disjunction of selectors +# Assumptions: top-to-bottom overrides is sufficient logic + +--- +# General fields +iEEGCoordsystemGeneral: + selectors: + - datatype == "ieeg" + - suffix == "coordsystem" + fields: + IntendedFor__ds_relative: + level: optional + description_addendum: | + If only a surface reconstruction is available, this should point to + the surface reconstruction file. + Note that this file should have the same coordinate system + specified in `iEEGCoordinateSystem`. + For example, **T1**: `'bids::sub-