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

[ENH] Propose to use *_channels.json for the description of coordinate systems #1524

Closed
wants to merge 12 commits into from
35 changes: 32 additions & 3 deletions src/modality-specific-files/motion.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ Motion specific fields SHOULD be present:
"InstitutionName": "Fictive Institution",
"MotionChannelCount": 18,
"RecordingDuration": 4667.641106,
"RotationRule": "right-hand",
"RotationOrder": "ZXY",
"SpatialAxes": "FRU",
"SubjectArtefactDescription": "n/a",
"TrackedPointsCount" : 2,
"ACCELChannelCount": 6,
Expand Down Expand Up @@ -200,3 +197,35 @@ t2_gyro_x x GYRO RightWrist rad/s
t2_gyro_y y GYRO RightWrist rad/s
t2_gyro_z z GYRO RightWrist rad/s
```

## Reference frame description (`*_channels.json`)

It is RECOMMENDED that the `*_channels.json` file contains additional metadata about channel which cannot be found in the `*_channels.tsv` or `*_motion.json` file.
One RECOMMENDED use case is the information about the reference frame the data is to be interpreted in.
The definition SHOULD be stored in a field called `reference_frame`, the defined level CAN be matched to a value in the `reference_frame` colunm in the `*_channels.tsv` file.
The use of a meanigful combination of `RotationRule`, `RotationOrder` and `SpatialAxis` for this definition is RECOMMENDED.
If non of these principals apply for the motion data, it is RECOMMENDED to use a free form field `CoordinateSystemDescription` for the definition.

### Example of `*_channels.json`

```json
Copy link
Member

Choose a reason for hiding this comment

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

would be nice to have a short TSV example with "reference_frame" "local" somewhere. Either a new one here or in the existing example above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I only did one example for now. In my experience that is less complicated, than providing multiple ones. It is mentioned in the text, that the reference_frame column is only RECOMMENDED.

"reference_frame": {
"Levels": {
"global": {
"CoordinateSystemDescription": "n/a",
"SpatialAxes": "ALS",
"RotationOrder": "ZXY",
"RotationRule": "right-hand"
},
"local": {
"CoordinateSystemDescription": "Joint angles are described following the ISB-based coordinate system,
with a local reference frame attached to the body segment.
See Wu and Cavanagh (1995), Wu et al. (2002), Wu et al. (2005),
and the Xsens MVN Awinda user manual for more information.",
"SpatialAxes": "n/a",
"RotationOrder": "n/a",
"RotationRule": "n/a"
}
}
}
```
14 changes: 14 additions & 0 deletions src/schema/objects/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,20 @@ reference__ieeg:
- type: string
enum:
- n/a
# reference frame column for channels.tsv files for motion data
reference_frame__motion:
name: reference
display_name: Reference frame
description: |
Specification of a reference frame in which the motion data are to be interpreted.
The value MUST match any of used key-value pair in the `*_channels.json` file in the motion directory.
It is RECOMMENDED to use a meanigful combination of `RotationRule`, `RotationOrder` and `SpatialAxis` for the specification.
If a channel is not to be interpreted in a reference frame use `n/a`.
anyOf:
- type: string
- type: string
enum:
- n/a
respiratory:
name: respiratory
display_name: Respiratory measurement
Expand Down
3 changes: 0 additions & 3 deletions src/schema/rules/sidecars/motion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,10 @@ motionRecommended:
MotionChannelCount: recommended
ORNTChannelCount: recommended
POSChannelCount: recommended
RotationOrder: recommended
RotationRule: recommended
SamplingFrequencyEffective:
level: recommended
description_addendum: |
If not available, the field takes value `n/a`.
SpatialAxes: recommended
SubjectArtefactDescription: recommended
TrackedPointsCount: recommended
TrackingSystemName: optional
Expand Down
1 change: 1 addition & 0 deletions src/schema/rules/tabular_data/motion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ motionChannels:
columns:
name__channels: required
component: required
reference_frame__motion: recommended
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
type__motion_channels: required
tracked_point__channels: required
units__motion: required
Expand Down