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] Allow (but discourage) task, acquisition and run entities for coordsystem.json and electrodes.tsv #1888

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 6 additions & 0 deletions src/modality-specific-files/electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ landmarks or fiducials during an EEG session/run, must be stored separately in
the corresponding `*_T1w.json` or `*_T2w.json` file and should be expressed in
voxels (starting from `[0, 0, 0]`).

`*_coordsystem.json` files SHOULD NOT be duplicated for each data file,
for example, across multiple tasks.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate coordinate system description for a given data file.
If electrodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this.

### Example `*_coordsystem.json`

```JSON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ A guide for using macros can be found at
-->
{{ MACROS___make_json_table("json.ieeg.iEEGCoordsystemPositions") }}

`*_coordsystem.json` files SHOULD NOT be duplicated for each data file,
for example, across multiple tasks.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate coordinate system description for a given data file.
If electrodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this.

### Recommended 3D coordinate systems

It is preferred that electrodes are localized in a 3D coordinate system (with
Expand Down
5 changes: 5 additions & 0 deletions src/modality-specific-files/magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ For more information on typical coordinate systems for MEG-MRI coregistration:
or:
[Coordinate Systems - Brainstorm toolbox](https://neuroimage.usc.edu/brainstorm/CoordinateSystems)

`*_coordsystem.json` files SHOULD NOT be duplicated for each data file,
for example, across multiple tasks.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate coordinate system description for a given data file.

## Landmark photos (`*_photo.<extension>`)

Photos of the anatomical landmarks and/or head localization coils
Expand Down
6 changes: 6 additions & 0 deletions src/modality-specific-files/near-infrared-spectroscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@ A guide for using macros can be found at

{{ MACROS___make_json_table(["json.nirs.AnatomicalLandmark", "json.nirs.AnatomicalLandmarkCoordinateSystemDescriptionRec"]) }}

`*_coordsystem.json` files SHOULD NOT be duplicated for each data file,
for example, across multiple tasks.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate coordinate system description for a given data file.
If optodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this.

### Example `*_coordsystem.json`

```json
Expand Down
34 changes: 34 additions & 0 deletions src/schema/rules/checks/channels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
ElectrodeSpecificity:
issue:
code: EXCESSIVE_ELECTRODE_SPECIFICITY
message: |
Task, acquisition or run entities detected in electrodes.tsv.
Electrode definitions should generally not vary within a session.
Consider removing the excess entity/entities or create a new
session each time electrodes are reconfigured.
level: warning
selectors:
- suffix == 'electrodes'
- extension == '.tsv'
checks:
- '!("task" in entities)'
- '!("acquisition" in entities)'
- '!("run" in entities)'

CoordsystemSpecificity:
issue:
code: EXCESSIVE_COORDSYSTEM_SPECIFICITY
message: |
Task, acquisition or run entities detected in coordsystem.tsv.
Coordinate systems should generally not vary within a session.
Consider removing the excess entity/entities or create new
sessions when multiple coordinate systems are appropriate.
level: warning
selectors:
- suffix == 'coordsystem'
- extension == '.json'
checks:
- '!("task" in entities)'
- '!("acquisition" in entities)'
- '!("run" in entities)'
15 changes: 0 additions & 15 deletions src/schema/rules/checks/electrodes.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions src/schema/rules/files/raw/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ coordsystem:
entities:
subject: required
session: optional
task: optional
acquisition: optional

# (i)EEG has a space entity
Expand All @@ -69,6 +70,7 @@ electrodes:
entities:
subject: required
session: optional
task: optional
acquisition: optional
run: optional
space: optional
Expand Down