Skip to content

Commit

Permalink
SCHEMA: Sync table definitions, render from schema
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Sep 30, 2022
1 parent f624497 commit 3ce06ae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,33 +171,16 @@ when measurements are taken with a continuous wave (CW) device that saves the da
as optical density, the `type` should be `NIRSCWOPTICALDENSITY` and the `units` should be `unitless`,
this is equivalent to SNIRF data type `dOD`.

The following columns MUST be present:

{{ MACROS___make_columns_table(
{
"name__channels": "REQUIRED",
"type__nirs_channels": "REQUIRED",
"source__channels": "REQUIRED",
"detector__channels": "REQUIRED",
"wavelength_nominal": "REQUIRED",
"units__nirs": "REQUIRED",
"sampling_frequency": "OPTIONAL but REQUIRED if `SamplingFrequency` is `n/a` in `_nirs.json`",
"orientation_component": "OPTIONAL but REQUIRED if `type` is `ACCEL`, `GYRO` or `MAGN`",
}
) }}

The following columns MAY be present:

{{ MACROS___make_columns_table(
{
"wavelength_actual": "OPTIONAL",
"description": "OPTIONAL",
"wavelength_emission_actual": "OPTIONAL",
"short_channel": "OPTIONAL",
"status": "OPTIONAL",
"status_description": "OPTIONAL",
}
) }}
The columns of the channels description table stored in `*_channels.tsv` are:

<!-- This block generates a columns table.
The definitions of these fields can be found in
src/schema/rules/tabular_data/*.yaml
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->

{{ MACROS___make_columns_table("nirs.nirsChannels") }}

### Restricted keyword list for the channel types

Expand Down Expand Up @@ -254,30 +237,9 @@ placed, these can be listed in the template values
SNIRF contains arrays for both
the 3D and 2D locations of data. In BIDS the `*_optodes.tsv` file MUST contain the 3D locations. Only in case 3D positions are unavailable the 2D locations should be used, setting the z field to an `n/a` value.

The following columns MUST be present:

{{ MACROS___make_columns_table(
{
"name__optodes": "REQUIRED",
"type__optodes": "REQUIRED",
"x__optodes": "REQUIRED",
"y__optodes": "REQUIRED",
"z__optodes": "REQUIRED",
}
) }}

The following columns MAY be present:

{{ MACROS___make_columns_table(
{
"x__template": "OPTIONAL but REQUIRED if `x` is `n/a`",
"y__template": "OPTIONAL but REQUIRED if `y` is `n/a`",
"z__template": "OPTIONAL but REQUIRED if `z` is `n/a`",
"description__optode": "OPTIONAL",
"detector_type": "OPTIONAL",
"source__optodes": "OPTIONAL",
}
) }}
The columns of the optodes description table stored in `*_optodes.tsv` are:

{{ MACROS___make_columns_table("nirs.nirsOptodes") }}

Example:
```Text
Expand Down
31 changes: 21 additions & 10 deletions src/schema/rules/tabular_data/nirs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ nirsChannels:
initial_columns:
- name__channels
- type__nirs_channels
- source__optodes
- detector_type
- source__channels
- detector__channels
- wavelength_nominal
- units__nirs
columns:
name__channels: required
type__nirs_channels: required
source__optodes: required
detector_type: required
source__channels: required
detector__channels: required
wavelength_nominal: required
units__nirs: required
orientation_component: optional
sampling_frequency:
level: optional
level_addendum: required if `SamplingFrequency` is `n/a` in `_nirs.json`
orientation_component:
level: optional
level_addendum: required if `type` is `ACCEL`, `GYRO` or `MAGN`
wavelength_actual: optional
description__optode: optional
description: optional
wavelength_emission_actual: optional
short_channel: optional
status: optional
Expand All @@ -44,10 +49,16 @@ nirsOptodes:
x__optodes: required
y__optodes: required
z__optodes: required
x__template: optional
y__template: optional
z__template: optional
description: optional
x__template:
level: optional
level_addendum: required if `x` is `n/a`
y__template:
level: optional
level_addendum: required if `y` is `n/a`
z__template:
level: optional
level_addendum: required if `z` is `n/a`
description__optode: optional
detector_type: optional
source__optodes: optional
additional_columns: allowed_if_defined

0 comments on commit 3ce06ae

Please sign in to comment.