Skip to content

Commit 51a40fb

Browse files
effigiessappelhoff
andauthored
ENH: Define channel column for events and Delimiter field for column descriptions (#1483)
* ENH: Define a channel column for events * ENH: Define a Delimiter field for column descriptions * be clear that not the column is a list of values, but each row in that column * extend example in events spec to include delimiters * use HED in example * Update src/schema/objects/columns.yaml Co-authored-by: Chris Markiewicz <[email protected]> * Update src/modality-specific-files/task-events.md --------- Co-authored-by: Stefan Appelhoff <[email protected]>
1 parent 426de56 commit 51a40fb

File tree

5 files changed

+68
-12
lines changed

5 files changed

+68
-12
lines changed

src/common-principles.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ and a guide for using macros can be found at
483483
),
484484
"Levels": "RECOMMENDED",
485485
"Units": "RECOMMENDED",
486+
"Delimiter": "OPTIONAL",
486487
"TermURL": "RECOMMENDED",
487488
"HED": "OPTIONAL",
488489
}

src/modality-specific-files/task-events.md

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ A guide for using macros can be found at
8282
Example of the content of the TSV file:
8383

8484
```Text
85-
onset duration trial_type response_time stim_file
86-
1.23 0.65 start 1.435 images/red_square.jpg
87-
5.65 0.65 stop 1.739 images/blue_square.jpg
85+
onset duration trial_type response_time stim_file channel annots
86+
1.23 0.65 start 1.435 images/red_square.jpg n/a n/a
87+
5.65 0.65 stop 1.739 images/blue_square.jpg n/a n/a
88+
12.1 2.35 n/a n/a n/a F,1|F,2|Cz musc
8889
```
8990

9091
In the accompanying JSON sidecar, the `trial_type` column might look as follows:
@@ -98,12 +99,49 @@ In the accompanying JSON sidecar, the `trial_type` column might look as follows:
9899
"start": "A red square is displayed to indicate starting",
99100
"stop": "A blue square is displayed to indicate stopping"
100101
}
102+
},
103+
"channel": {
104+
"Description": "Channel(s) associated with the event",
105+
"Delimiter": "|"
106+
},
107+
"annots": {
108+
"LongName": "Annotations",
109+
"Description": "Annotations associated with channels indicated in the channel column.",
110+
"Levels": {
111+
"musc": "Muscle artifact. A very common, high frequency, sharp artifact that corresponds with agitation/nervousness in a patient."
112+
},
113+
"HED": {
114+
"musc": "EMG-artifact"
115+
}
101116
}
102117
}
103118
```
104119

105-
Note that all other columns SHOULD also be described but are omitted for the
106-
sake of brevity.
120+
Note that in the example above:
121+
122+
1. Only a subset of columns are described for the sake of brevity.
123+
In a real dataset, all other columns SHOULD also be described.
124+
125+
1. The `channel` column contains a list of values that are separated
126+
by a delimiter (`|`), as is declared in the `Delimiter` metadata
127+
field of the `events.json file.
128+
Thus, the channels related to the event in the third row of the example
129+
are called `F,1`, `F,2`, and `Cz`.
130+
131+
1. The example contains a column called `annots`.
132+
This column is not defined in BIDS, and constitutes additional, arbitrary
133+
(that is, unofficial) metadata.
134+
In the present case, it is used to describe artifacts in the data,
135+
in reference to the `channel` column.
136+
The `annots` column is making
137+
use of the powerful HED system for documenting events, see below.
138+
139+
Events MAY also be documented in machine-actionable form
140+
using HED (Hierarchical Event Descriptor) tags.
141+
This type of documentation is particularly useful for datasets likely to be used
142+
in event-related analyses.
143+
See [Hierarchical Event Descriptors](../appendices/hed.md)
144+
for additional information and examples.
107145

108146
For multi-echo files, the `events.tsv` file is applicable to all echos of
109147
a particular run:
@@ -125,13 +163,6 @@ A guide for using macros can be found at
125163
}
126164
) }}
127165

128-
Note: Events can also be documented in machine-actionable form
129-
using HED (Hierarchical Event Descriptor) tags.
130-
This type of documentation is particularly useful for datasets likely to be used
131-
in event-related analyses.
132-
See [Hierarchical Event Descriptors](../appendices/hed.md)
133-
for additional information and examples.
134-
135166
## Stimuli
136167

137168
Additional information about the stimuli can be added in the `events.tsv`

src/schema/objects/columns.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ cardiac:
4848
description: |
4949
continuous pulse measurement
5050
type: number
51+
channel:
52+
name: channel
53+
display_name: Channel
54+
description: |
55+
Channel(s) associated with an event.
56+
If multiple channels are specified, they MUST be separated by a delimiter
57+
specified in the `"Delimiter"` field describing the `channel` column.
58+
For example, channels separated with a comma (`,`) require the `events.json`
59+
file to contain `"channel": {"Delimiter": ","}`.
60+
In the absence of a delimiter, tools MUST interpret any character as being part
61+
of a channel name.
62+
type: string
5163
color:
5264
name: color
5365
display_name: Color label

src/schema/objects/metadata.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,13 @@ DelayTime:
572572
This field is mutually exclusive with `"VolumeTiming"`.
573573
type: number
574574
unit: s
575+
Delimiter:
576+
name: Delimiter
577+
display_name: Delimiter
578+
description: |
579+
If rows in a column may be interpreted as a lists of values, the character that
580+
separates one value from the next.
581+
type: string
575582
Density:
576583
name: Density
577584
display_name: Density

src/schema/rules/tabular_data/task.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ TaskEvents:
1010
response_time: optional
1111
HED: optional
1212
stim_file: optional
13+
channel:
14+
level: optional
15+
description_addendum: |
16+
Note that this column only applies to data types where
17+
channels are specified, such as EEG, iEEG, MEG or NIRS.
1318
additional_columns: allowed
1419
initial_columns:
1520
- onset

0 commit comments

Comments
 (0)