From d04ffe0aec40e13358f7b8adbd3dafe12cedc5a0 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 14 Jul 2023 08:46:08 -0400 Subject: [PATCH 1/4] [FIX] Clarify that electrodes.tsv is permissible for simultaneous MEG/EEG --- src/modality-specific-files/magnetoencephalography.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modality-specific-files/magnetoencephalography.md b/src/modality-specific-files/magnetoencephalography.md index c85e20f7ce..2cc36666ac 100644 --- a/src/modality-specific-files/magnetoencephalography.md +++ b/src/modality-specific-files/magnetoencephalography.md @@ -98,8 +98,10 @@ it SHOULD be stored separately under a new `/eeg` data type If however EEG is recorded simultaneously **with the same MEG system**, it MAY be stored under the `/meg` data type. In that case, it SHOULD have the same sampling frequency as MEG (see `SamplingFrequency` field below). -Furthermore, the EEG sensor coordinates SHOULD be specified using MEG-specific coordinate -systems (see [coordinates section](#coordinate-system-json-_coordsystemjson) below and +Furthermore, EEG sensor coordinates SHOULD be recorded in an +[`electrodes.tsv`](electroencephalography.md#electrodes-description-_electrodestsv) +file using MEG-specific coordinate systems +(see [Coordinate System JSON](#coordinate-system-json-_coordsystemjson) below and the [Coordinate Systems Appendix](../appendices/coordinate-systems.md)). ### Sidecar JSON (`*_meg.json`) From b5a222af53638326d56a63bb8d92a2a9b0902e83 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 14 Jul 2023 08:47:53 -0400 Subject: [PATCH 2/4] [SCHEMA] Permit electrodes.tsv for MEG --- src/schema/rules/files/raw/channels.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/schema/rules/files/raw/channels.yaml b/src/schema/rules/files/raw/channels.yaml index 2c74cc405e..06c213be17 100644 --- a/src/schema/rules/files/raw/channels.yaml +++ b/src/schema/rules/files/raw/channels.yaml @@ -72,6 +72,15 @@ electrodes: acquisition: optional space: optional +# MEG has an additional entity available +electrodes__meg: + $ref: rules.files.raw.channels.electrodes + datatypes: + - meg + entities: + $ref: rules.files.raw.channels.electrodes.entities + processing: optional + optodes: suffixes: - optodes From befd54cc5b4e680b9ffc475e30225bb28093b024 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 14 Jul 2023 09:05:36 -0400 Subject: [PATCH 3/4] [SCHEMA] electrodes.tsv is RECOMMENDED if EEGChannelCount > 0 --- src/schema/rules/checks/meg.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/schema/rules/checks/meg.yaml diff --git a/src/schema/rules/checks/meg.yaml b/src/schema/rules/checks/meg.yaml new file mode 100644 index 0000000000..561d66505c --- /dev/null +++ b/src/schema/rules/checks/meg.yaml @@ -0,0 +1,14 @@ +# Rules for MEG data that cannot be defined in tables +--- +MEGElectrodesRecommended: + issue: + code: MEG_EEG_ELECTRODES_RECOMMENDED + message: | + A nonzero EEGChannelCount for MEG datasets indicates the presence of EEG + channels. A corresponding `electrodes.tsv` file should be be added. + level: warning + selectors: + - suffix == "meg" + - sidecar.EEGChannelCount > 0 + checks: + - type(associations.electrodes) != 'null' From 3772352bd11e3cd831e6ef7183ef73770438e54b Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 23 Aug 2023 23:52:06 -0400 Subject: [PATCH 4/4] Address review --- .../magnetoencephalography.md | 11 ++++++----- src/schema/rules/checks/meg.yaml | 14 -------------- 2 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 src/schema/rules/checks/meg.yaml diff --git a/src/modality-specific-files/magnetoencephalography.md b/src/modality-specific-files/magnetoencephalography.md index 2cc36666ac..490662d34a 100644 --- a/src/modality-specific-files/magnetoencephalography.md +++ b/src/modality-specific-files/magnetoencephalography.md @@ -89,16 +89,17 @@ which some installations impose to be run on raw data prior to analysis. Such processing steps are needed for example because of active shielding software corrections that have to be performed to before the MEG data can actually be exploited. -### Recording EEG simultaneously with MEG +### Recording (i)EEG simultaneously with MEG -Note that if EEG is recorded with a separate amplifier, +Note that if (i)EEG is recorded with a separate amplifier, it SHOULD be stored separately under a new `/eeg` data type -(see [the EEG specification](electroencephalography.md)). +(see the [EEG](electroencephalography.md) and +[iEEG](intracranial-electroencephalography.md) specifications). -If however EEG is recorded simultaneously **with the same MEG system**, +If however (i)EEG is recorded simultaneously **with the same MEG system**, it MAY be stored under the `/meg` data type. In that case, it SHOULD have the same sampling frequency as MEG (see `SamplingFrequency` field below). -Furthermore, EEG sensor coordinates SHOULD be recorded in an +Furthermore, (i)EEG sensor coordinates MAY be recorded in an [`electrodes.tsv`](electroencephalography.md#electrodes-description-_electrodestsv) file using MEG-specific coordinate systems (see [Coordinate System JSON](#coordinate-system-json-_coordsystemjson) below and diff --git a/src/schema/rules/checks/meg.yaml b/src/schema/rules/checks/meg.yaml deleted file mode 100644 index 561d66505c..0000000000 --- a/src/schema/rules/checks/meg.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Rules for MEG data that cannot be defined in tables ---- -MEGElectrodesRecommended: - issue: - code: MEG_EEG_ELECTRODES_RECOMMENDED - message: | - A nonzero EEGChannelCount for MEG datasets indicates the presence of EEG - channels. A corresponding `electrodes.tsv` file should be be added. - level: warning - selectors: - - suffix == "meg" - - sidecar.EEGChannelCount > 0 - checks: - - type(associations.electrodes) != 'null'