Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Clarify that electrodes.tsv is optional for MEG, for use with simultaneous (i)EEG #1555

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/modality-specific-files/magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO the SHOULD should become a MAY.

So far, the spec allowed for recording electrode positions in the _headshape: https://bids-specification.readthedocs.io/en/stable/glossary.html#headshape-suffixes

[`electrodes.tsv`](electroencephalography.md#electrodes-description-_electrodestsv)
file using MEG-specific coordinate systems
(see [Coordinate System JSON](#coordinate-system-json-_coordsystemjson) below and
effigies marked this conversation as resolved.
Show resolved Hide resolved
the [Coordinate Systems Appendix](../appendices/coordinate-systems.md)).

### Sidecar JSON (`*_meg.json`)
Expand Down
14 changes: 14 additions & 0 deletions src/schema/rules/checks/meg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Rules for MEG data that cannot be defined in tables
---
MEGElectrodesRecommended:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as outlined in #1550 (comment), I think this should be optional --> this electrode information can also be stored in _headshape.<ext> files or sometimes in the data file format itself (Elekta/Neuromag/MEGIN).

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'
9 changes: 9 additions & 0 deletions src/schema/rules/files/raw/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down