Skip to content

Commit ad50350

Browse files
authored
[BEP032] Review and clean-up suggestions (#2293)
* enhancement(units): Remove dimension_unit and add default mm for probe * cleanup: remove resolved comment * cleanup: remove resolved comment * cleanup(schema): mark hemisphere__probes for future unification with base hemispher column * cleanup: comments about unifying probes and electrodes column * fix(schema): use um² for microephys electrode size Microelectrodes require micrometer-scale measurements different from iEEG. Added size__microephys with um² units. * fix(schema): remove use of dimension_unit in microephys * cleanup: remove unused surgery_date column (moved as comment to PR #1839) * fix(desc): include microephys for channel column in events * fix(typo): microeelectrode in events * refactor(schema): use base x/y/z columns with addendums for electrodes * change(units): remove unavailble dimension_unit reference and add um in accordance with ProbeInterface norms * fix(docs): add link to markdown for 2D coordinate systems * cleanup: remove resolved TODO comment by 6284d36 * cleanup(rule): remove unsused older check for coordystem file * future cleanup(schema): add a comment of a potential column desc unification * refactor(schema): use base unit column like iEEG for channels
1 parent 7c6aed2 commit ad50350

6 files changed

Lines changed: 60 additions & 118 deletions

File tree

src/schema/objects/columns.yaml

Lines changed: 16 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@ depth__probes:
166166
name: depth
167167
display_name: Depth
168168
description: |
169-
Physical depth of the probe, for example, '0.3'.
169+
Physical depth of the probe in mm, for example, '0.3'.
170170
This dimension should be omitted or set to 0 for two-dimensional (shank-type) probes.
171171
This dimension corresponds to the z-axis of the probe's local coordinate frame.
172172
type: number
173+
unit: mm
173174
coordinate_system:
174175
name: coordinate_system
175176
display_name: Coordinate System
@@ -244,15 +245,6 @@ dimension:
244245
Size of the group (grid/strip/probe) that this electrode belongs to.
245246
Must be of form `[AxB]` with the smallest dimension first (for example, `[1x8]`).
246247
type: string
247-
# TODO: Add unit enums if everyone agrees to keep this column.
248-
dimension_unit:
249-
name: dimension_unit
250-
display_name: Dimension unit
251-
description: |
252-
Spatial units for a position or a physical dimension of electrodes, such as
253-
'width', 'height' or 'depth' of the probe.
254-
For example, `um`.
255-
type: string
256248
duration:
257249
name: duration
258250
display_name: Event duration
@@ -297,7 +289,6 @@ filename:
297289
Relative paths to files.
298290
type: string
299291
format: participant_relative
300-
# TODO: Figure out and add rule for default values.
301292
gain:
302293
name: gain
303294
display_name: Gain
@@ -306,7 +297,6 @@ gain:
306297
to the signal stored in the data file.
307298
If no gain factor is provided it is assumed to be 1.
308299
type: number
309-
# TODO: Clarify if the optionality of the column be defined here or as an addendum in the rules.
310300
ground:
311301
name: ground
312302
display_name: Ground
@@ -369,10 +359,11 @@ height__probes:
369359
name: height
370360
display_name: Probe height
371361
description: |
372-
Physical height of the probe, for example, '0.3'.
362+
Physical height of the probe in mm, for example, '0.3'.
373363
This dimension should be omitted or set to 0 for one-dimensional (linear) probes.
374364
This dimension corresponds to the y-axis of the probe's local coordinate frame.
375365
type: number
366+
unit: mm
376367
hemisphere:
377368
name: hemisphere
378369
display_name: Electrode hemisphere
@@ -382,7 +373,7 @@ hemisphere:
382373
enum:
383374
- $ref: objects.enums.left_hemisphere.value
384375
- $ref: objects.enums.right_hemisphere.value
385-
# TODO: Should the hemisphere details be unified for electrodes and probes or will it break other modality?
376+
# consider unifying with base `hemisphere` column between electrodes and probes
386377
hemisphere__probes:
387378
name: hemisphere
388379
display_name: Hemisphere
@@ -453,7 +444,7 @@ manufacturer:
453444
The manufacturer for each electrode.
454445
Can be used if electrodes were manufactured by more than one company.
455446
type: string
456-
# TODO: Should the manufacturer details be unified for electrodes and probes?
447+
# consider unifying with base `manufacturer` column between electrodes and probes
457448
manufacturer__probes:
458449
name: manufacturer
459450
display_name: Manufacturer
@@ -466,6 +457,7 @@ mapping:
466457
description: |
467458
Corresponding integer label in the standard BIDS label lookup.
468459
type: integer
460+
# consider unifying with base `material` column between electrodes and probes
469461
material:
470462
name: material
471463
display_name: Electrode material
@@ -834,7 +826,6 @@ short_channel:
834826
The total number of channels listed as short channels
835827
SHOULD be stored in `ShortChannelCount` in `*_nirs.json`.
836828
type: boolean
837-
# TODO: might need to dup for microephys__size and have it um^2
838829
signal_electrode:
839830
name: signal_electrode
840831
display_name: Signal electrode
@@ -849,6 +840,13 @@ size:
849840
Surface area of the electrode, units MUST be in `mm^2`.
850841
type: number
851842
unit: 'mm^2'
843+
size__microephys:
844+
name: size
845+
display_name: Electrode size
846+
description: |
847+
Surface area of the electrode, units MUST be in `um^2`.
848+
type: number
849+
unit: 'um^2'
852850
software_filters:
853851
name: software_filters
854852
display_name: Software filters
@@ -956,16 +954,6 @@ stream_id:
956954
description: |
957955
Data stream of the recording the signal.
958956
type: string
959-
# TODO: Clarify if column values can be arrays.
960-
surgery_date:
961-
name: surgery_date
962-
display_name: Surgery date
963-
description: |
964-
Date(s) of surgery. Datetime format and their anonymization
965-
are described in [Units](SPEC_ROOT/common-principles.md#units).
966-
The details of the surgery should be described in the sidecar json file.
967-
type: string
968-
format: datetime
969957
target_muscle:
970958
name: target_muscle
971959
display_name: Target muscle
@@ -1132,15 +1120,6 @@ units:
11321120
(see [Units](SPEC_ROOT/common-principles.md#units)).
11331121
type: string
11341122
format: unit
1135-
units__channels:
1136-
name: units
1137-
display_name: Units
1138-
description: |
1139-
Physical unit of the value represented in this channel,
1140-
for example, `V` for Volt, or `uV` for micro Volt
1141-
(see [Units](SPEC_ROOT/common-principles.md#units)).
1142-
type: string
1143-
format: unit
11441123
units__nirs:
11451124
name: units
11461125
display_name: Units
@@ -1208,9 +1187,10 @@ width__probes:
12081187
name: width
12091188
display_name: Width
12101189
description: |
1211-
Physical width of the probe, for example, '5'.
1190+
Physical width of the probe in mm, for example, '5'.
12121191
This dimension corresponds to the x-axis of the probe's local coordinate frame.
12131192
type: number
1193+
unit: mm
12141194
whole_blood_radioactivity:
12151195
name: whole_blood_radioactivity
12161196
display_name: Whole blood radioactivity
@@ -1267,54 +1247,6 @@ z__optodes:
12671247
- type: string
12681248
enum:
12691249
- n/a
1270-
# TODO: Remove the overspecified entries for electrode positions if not used in microephys
1271-
# TODO: finish up setup below
1272-
x__electrodes:
1273-
name: x
1274-
display_name: Electrode X position
1275-
description: |
1276-
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
1277-
the position along the local width-axis relative to the probe origin
1278-
(see `coordinate_reference_point` in `*_probes.tsv`).
1279-
Units are specified by the `dimension_unit` column in `*_probes.tsv`.
1280-
1281-
When a `space-<label>` entity is used in the filename,
1282-
the position relative to the origin of the coordinate system along the first axis.
1283-
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
1284-
type: number
1285-
y__electrodes:
1286-
name: y
1287-
display_name: Electrode Y position
1288-
description: |
1289-
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
1290-
the position along the local height-axis relative to the probe origin
1291-
(see `coordinate_reference_point` in `*_probes.tsv`).
1292-
Units are specified by the `dimension_unit` column in `*_probes.tsv`.
1293-
1294-
When a `space-<label>` entity is used in the filename,
1295-
the position relative to the origin of the coordinate system along the second axis.
1296-
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
1297-
type: number
1298-
z__electrodes:
1299-
name: z
1300-
display_name: Electrode Z position
1301-
description: |
1302-
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
1303-
the position along the local depth-axis relative to the probe origin
1304-
(see `coordinate_reference_point` in `*_probes.tsv`).
1305-
Units are specified by the `dimension_unit` column in `*_probes.tsv`.
1306-
1307-
When a `space-<label>` entity is used in the filename,
1308-
the position relative to the origin of the coordinate system along the third axis.
1309-
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
1310-
1311-
For 2D electrode localizations (for example, when the coordinate system is
1312-
`Pixels`), this SHOULD be a column of `n/a` values.
1313-
anyOf:
1314-
- type: number
1315-
- type: string
1316-
enum:
1317-
- n/a
13181250
template_x:
13191251
name: template_x
13201252
display_name: X template position

src/schema/objects/metadata.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,9 +2237,6 @@ MEGREFChannelCount:
22372237
`MEGREFChannelCount` should be set to `0`.
22382238
type: integer
22392239
minimum: 0
2240-
# TODO: Change if needs to be broken down into ecephys and icephys
2241-
# TODO: Add links to the 2D coordinate system, Pixels and glossary entry.
2242-
# TODO: Add enums for the valid values specific to microephys
22432240
MicroephysCoordinateSystem:
22442241
name: MicroephysCoordinateSystem
22452242
display_name: Microephys Coordinate System
@@ -2253,7 +2250,8 @@ MicroephysCoordinateSystem:
22532250
pixel indices in a 2D image (of either a volume-rendering,
22542251
surface-rendering, operative photo, or operative drawing),
22552252
this MUST be "Pixels". For more information, see the section
2256-
on 2D coordinate systems.
2253+
[allowed 2D coordinate systems](SPEC_ROOT/modality-specific-files/\
2254+
microelectrode-electrophysiology.md#allowed-2d-coordinate-systems).
22572255
For a list of valid values for this field, see the associated glossary entry.
22582256
anyOf:
22592257
- $ref: objects.enums._MicroephysCoordSys

src/schema/rules/checks/channels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RequiredCoordsystem:
4242
selectors:
4343
- suffix == "electrodes"
4444
- extension == ".tsv"
45-
- '!intersects([datatype], ["ecephys", "icephys"])' # TODO: need to verify and unify how selector is used EMG
45+
- '!intersects([datatype], ["ecephys", "icephys"])'
4646
- datatype != "emg" # coordsys file may have space entity that electrodes.tsv lacks
4747
checks:
4848
- associations.coordsystem != null || associations.coordsystems != null

src/schema/rules/checks/microephys.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
---
2-
# For non-microephys modalities, electrodes.tsv always requires coordsystem.json
3-
RequiredCoordsystem:
4-
issue:
5-
code: REQUIRED_COORDSYSTEM
6-
message: |
7-
If an electrodes.tsv file is provided, an associated coordsystem.json must also be present.
8-
level: error
9-
selectors:
10-
- suffix == "electrodes"
11-
- extension == ".tsv"
12-
- '!intersects([datatype], ["ecephys", "icephys"])'
13-
checks:
14-
- associations.coordsystem != null
15-
162
# For microephys, only space-labeled electrodes.tsv requires coordsystem.json
3+
# Non-microephys modalities are handled by RequiredCoordsystem in channels.yaml
174
MicroephysRequiredCoordsystemWithSpace:
185
issue:
196
code: MICROEPHYS_COORDSYSTEM_REQUIRED

src/schema/rules/tabular_data/events.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ Events:
1313
level: optional
1414
description_addendum: |
1515
Note that this column only applies to data types where
16-
channels are specified, such as EEG, iEEG, MEG or NIRS.
16+
channels are specified, such as EEG, iEEG, MEG, NIRS or microephys.
1717
# TODO: Make the addendums more clear and descriptive
1818
data_entity_id:
1919
level: optional
2020
description_addendum: |
2121
Note that this column only applies to
22-
microelectrode eleectrophysiology data type.
22+
microelectrode electrophysiology data type.
2323
duration_index:
2424
level: optional
2525
description_addendum: |
2626
Note that this column only applies to
27-
microelectrode eleectrophysiology data type.
27+
microelectrode electrophysiology data type.
2828
onset_index:
2929
level: optional
3030
description_addendum: |
3131
Note that this column only applies to
32-
microelectrode eleectrophysiology data type.
32+
microelectrode electrophysiology data type.
3333
trial_id:
3434
level: optional
3535
description_addendum: |
3636
Note that this column only applies to
37-
microelectrode eleectrophysiology data type.
37+
microelectrode electrophysiology data type.
3838
additional_columns: allowed
3939
initial_columns:
4040
- onset

src/schema/rules/tabular_data/microephys.yaml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ microephysProbes:
2727
width__probes: optional
2828
height__probes: optional
2929
depth__probes: optional
30-
dimension_unit: optional
3130
rotation_angle: recommended
3231
coordinate_reference_point: recommended
3332
anatomical_reference_point: optional
@@ -48,19 +47,45 @@ microephysElectrodes:
4847
initial_columns:
4948
- name__electrodes
5049
- probe_name
51-
- x__electrodes
52-
- y__electrodes
53-
- z__electrodes
50+
- x
51+
- y
52+
- z
5453
columns:
5554
name__electrodes: required
5655
probe_name: required
57-
x__electrodes: required
58-
y__electrodes: required
59-
z__electrodes: required
56+
x:
57+
level: required
58+
description_addendum: |
59+
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
60+
the position along the local width-axis relative to the probe origin
61+
(see `coordinate_reference_point` in `*_probes.tsv`) in micrometers (um).
62+
When a `space-<label>` entity is used in the filename,
63+
the position relative to the origin of the coordinate system along the first axis.
64+
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
65+
y:
66+
level: required
67+
description_addendum: |
68+
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
69+
the position along the local height-axis relative to the probe origin
70+
(see `coordinate_reference_point` in `*_probes.tsv`) in micrometers (um).
71+
When a `space-<label>` entity is used in the filename,
72+
the position relative to the origin of the coordinate system along the second axis.
73+
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
74+
z:
75+
level: required
76+
description_addendum: |
77+
When no [`space-<label>`](SPEC_ROOT/appendices/entities.md#space) entity is used in the filename,
78+
the position along the local depth-axis relative to the probe origin
79+
(see `coordinate_reference_point` in `*_probes.tsv`) in micrometers (um).
80+
When a `space-<label>` entity is used in the filename,
81+
the position relative to the origin of the coordinate system along the third axis.
82+
Units are specified by `MicroephysCoordinateUnits` in the corresponding `*_coordsystem.json` file.
83+
For 2D electrode localizations (for example, when the coordinate system is
84+
`Pixels`), this SHOULD be a column of `n/a` values.
6085
hemisphere: recommended
6186
impedance: recommended
6287
shank_id: optional
63-
size: optional
88+
size__microephys: optional
6489
electrode_shape: optional
6590
material: optional
6691
location: recommended
@@ -79,13 +104,13 @@ microephysChannels:
79104
- name__channels
80105
- reference__microephys
81106
- type__channels
82-
- units__channels
107+
- units
83108
- sampling_frequency
84109
columns:
85110
name__channels: required
86111
reference__microephys: required
87112
type__channels: required
88-
units__channels: required
113+
units: required
89114
sampling_frequency: optional
90115
low_cutoff: optional
91116
high_cutoff: optional

0 commit comments

Comments
 (0)