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] add optional presentation software name, version, OS, and code to events.json #573

Merged
merged 36 commits into from
Sep 15, 2020
Merged
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2c40175
add presentation software name version OS and code
Remi-Gau Aug 15, 2020
2571dff
make minor changes
Remi-Gau Aug 16, 2020
90b2095
fix linter
Remi-Gau Aug 16, 2020
5aeed7e
Update src/04-modality-specific-files/03-electroencephalography.md
Remi-Gau Aug 17, 2020
0a00782
fix typo
Remi-Gau Aug 17, 2020
4a265e3
add RRID examples and extend JSON examples
Remi-Gau Aug 17, 2020
45e46f5
fix linter tables
Remi-Gau Aug 17, 2020
f005b95
Apply suggestions from code review
Remi-Gau Aug 18, 2020
2ff0990
move stimulus presentation software details to the task event file
Remi-Gau Aug 20, 2020
c374f1f
move stimulus presentation info to data dictionary section
Remi-Gau Aug 20, 2020
3fbcfd9
update task-events
Remi-Gau Aug 24, 2020
7625ec8
Apply suggestions from code review
Remi-Gau Aug 25, 2020
b98d0b7
(re) apply the soft rule "sentences should start on a new line"
Remi-Gau Aug 26, 2020
3ee5cd0
Move OS examples out of table
Remi-Gau Aug 26, 2020
9bc6ec0
remove trailing white spaces
Remi-Gau Aug 26, 2020
e0b02f3
make the almighty linter gods happy
Remi-Gau Aug 26, 2020
a995fc9
Apply suggestions from code review
Remi-Gau Aug 26, 2020
3b366aa
Apply suggestions from code review
Remi-Gau Aug 29, 2020
d1636bf
create StimulusPresentation with subfields
Remi-Gau Aug 29, 2020
ddb98a8
Apply suggestions from code review
Remi-Gau Aug 29, 2020
343702e
fix linter
Remi-Gau Aug 29, 2020
7969be9
Change stimulus presentation table
Remi-Gau Aug 31, 2020
8a057a2
fix linter
Remi-Gau Aug 31, 2020
3e6b4f4
restructure the task_event file
Remi-Gau Sep 1, 2020
2e1441f
Apply suggestions from code review
Remi-Gau Sep 1, 2020
106b247
Add link to JSON object at end of task-events
Remi-Gau Sep 1, 2020
5b0aaf8
fix linter
Remi-Gau Sep 1, 2020
607d137
Apply suggestions from code review
Remi-Gau Sep 2, 2020
98f13e1
revert changes on non relevant files
Remi-Gau Sep 3, 2020
669e78c
Apply suggestions from code review
Remi-Gau Sep 9, 2020
4dd7afa
Apply suggestions from code review
Remi-Gau Sep 9, 2020
51f68f7
add link to URI bids starter kit at end of task events
Remi-Gau Sep 10, 2020
c8f4c58
fix linter
Remi-Gau Sep 10, 2020
9d6156e
change DOI for code example
Remi-Gau Sep 10, 2020
04f0926
fix MacOS -> macOS, be explicit that multiple distributions are allowed
sappelhoff Sep 15, 2020
46b0c14
clarify operating system key
sappelhoff Sep 15, 2020
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
148 changes: 109 additions & 39 deletions src/04-modality-specific-files/05-task-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@ sub-<label>/[ses-<label>]
```

Where `<matches>` corresponds to task file name. For example:
`sub-control01_task-nback`. It is also possible to have a single \_events.tsv
file describing events for all participants and runs (see [Inheritance Principle](../02-common-principles.md#the-inheritance-principle)).
As with all other tabular data, `_events` files may be
accompanied by a JSON file describing the columns in detail (see [here](../02-common-principles.md#tabular-files)).
`sub-control01_task-nback`.
It is also possible to have a single `_events.tsv` file describing events
for all participants and runs (see
[Inheritance Principle](../02-common-principles.md#the-inheritance-principle)).
As with all other tabular data, `_events.tsv` files MAY be accompanied by a JSON
file describing the columns in detail (see
[Tabular Files](../02-common-principles.md#tabular-files)).

The purpose of this file is to describe timing and other properties of events
recorded during the scan. Events MAY be either stimuli presented to the
participant or participant responses. A single event file MAY include any
combination of stimuli and response events. Events MAY overlap in time. Please
mind that this does not imply that only so called "event related" study designs
recorded during the scan.
Events MAY be either stimuli presented to the participant or participant responses.
A single event file MAY include any combination of stimuli and response events.
Events MAY overlap in time.
Please mind that this does not imply that only so called "event related" study designs
are supported (in contrast to "block" designs) - each "block of events" can be
represented by an individual row in the \_events.tsv file (with a long
duration). Each task events file REQUIRES a corresponding task imaging data file
duration).
Each task events file REQUIRES a corresponding task imaging data file
(but a single events file MAY be shared by multiple imaging data files - see
Inheritance principle). The tabular files consists of one row per event and a set of
REQUIRED and OPTIONAL columns:
[Inheritance Principle](../02-common-principles.md#the-inheritance-principle)).
The tabular files consists of one row per event and a set of REQUIRED
and OPTIONAL columns:

| Column name | Description |
|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onset | REQUIRED. Onset (in seconds) of the event measured from the beginning of the acquisition of the first volume in the corresponding task imaging data file. If any acquired scans have been discarded before forming the imaging data file, ensure that a time of 0 corresponds to the first image stored. In other words negative numbers in "onset" are allowed<sup>5</sup>. |
| duration | REQUIRED. Duration of the event (measured from onset) in seconds. Must always be either zero or positive. A "duration" value of zero implies that the delta function or event is so short as to be effectively modeled as an impulse. |
| sample | OPTIONAL. Onset of the event according to the sampling scheme of the recorded modality (i.e., referring to the raw data file that the `events.tsv` file accompanies). |
Expand All @@ -45,21 +51,21 @@ the first volume.

An arbitrary number of additional columns can be added. Those allow describing
other properties of events that could be later referred in modelling and
hypothesis extensions of BIDS.
Note that the `trial_type` and any additional columns in a TSV file SHOULD be
documented in an accompanying JSON sidecar file.

In case of multi-echo task run, a single `_events.tsv` file will suffice for all
echoes.
hypothesis extensions of BIDS.
Note that the `trial_type` and any additional columns in a TSV file
SHOULD be documented in an accompanying JSON sidecar file.

Example:

```Text
sub-control01/
func/
sub-control01_task-stopsignal_events.tsv
sub-control01_task-stopsignal_events.json
```

Example of the content of the TSV file:

```Text
onset duration trial_type response_time stim_file
1.2 0.6 go 1.435 images/red_square.jpg
Expand All @@ -79,7 +85,22 @@ In the accompanying JSON sidecar, the `trial_type` column might look as follows:
}
}
}
```
```

Note that all other columns SHOULD also be described but are omitted for the
sake of brevity.

For multi-echo files, the `*_events.tsv` file is applicable to all echos of
a particular run:

```Text
sub-01_task-cuedSGT_run-1_events.tsv
sub-01_task-cuedSGT_run-1_echo-1_bold.nii.gz
sub-01_task-cuedSGT_run-1_echo-2_bold.nii.gz
sub-01_task-cuedSGT_run-1_echo-3_bold.nii.gz
```

## Stimuli databases

References to existing databases can also be encoded using additional columns.
Example 2 includes references to the Karolinska Directed Emotional Faces (KDEF)
Expand All @@ -93,29 +114,76 @@ Example:
sub-control01/
func/
sub-control01_task-emoface_events.tsv
sub-control01_task-emoface_events.json
```

Example of the content of the TSV file:

```Text
onset duration trial_type identifier database response_time
1.2 0.6 afraid AF01AFAF kdef 1.435
5.6 0.6 angry AM01AFAN kdef 1.739
5.6 0.6 sad AF01ANSA kdef 1.739
```

This file should be accompanied by a data dictionary.
The `trial_type` and `identifier` columns from the `*_events.tsv` files might be described
in the accompanying JSON sidecar as follows:

```Text
sub-control01/
func/
sub-control01_task-emoface_events.json
```JSON
{
"trial_type": {
"LongName": "Emotion image type",
"Descripton": "Type of emotional face from Karolinska database that is displayed",
"Levels": {
"afraid": "A face showing fear is displayed",
"angry": "A face showing anger is displayed",
"sad": "A face showing sadness is displayed"
}
},
"identifier": {
"LongName": "Karolinska (KDEF) database identifier",
"Description": "ID from KDEF database used to identify the displayed image"
}
}
```

The `trial_type` and `identifier` columns from the `*_events.tsv` files might be described in this
dictionary as follows.
Note that all other columns SHOULD also be described but are omitted for the sake
of example.
Note that all other columns SHOULD also be described but are omitted for the
sake of brevity.

## Stimulus presentation details

It is RECOMMENDED to include details of the stimulus presentation software,
when applicable:

| Field name | Description |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| StimulusPresentation | RECOMMENDED. [Object][] containing key value pairs related to the software used to present the stimuli during the experiment, specifically: `OperatingSystem`, `SoftwareName`, `SoftwareRRID`, `SoftwareVersion` and `Code`. See table below for more information. |

The object supplied for `StimulusPresentation` SHOULD include the following key-value pairs:

| Key name | Description |
|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| OperatingSystem | RECOMMENDED. Operating system used to run the stimuli presentation software (for formatting recommendations, see examples below this table). |
| SoftwareName | RECOMMENDED. Name of the software that was used to present the stimuli. |
| SoftwareRRID | RECOMMENDED. [Research Resource Identifier](https://scicrunch.org/resources) of the software that was used to present the stimuli. Examples: The RRID for Psychtoolbox is 'SCR_002881', and that of PsychoPy is 'SCR_006571'. |
| SoftwareVersion | RECOMMENDED. Version of the software that was used to present the stimuli. |
| Code | RECOMMENDED. [URI][uri] of the code used to present the stimuli. Persistent identifiers such as DOIs are preferred. If multiple versions of code may be hosted at the same location, revision-specific URIs are recommended. |

The operating system description should include:
- type (Windows, MacOS, Linux),
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
- distribution (if applicable: Ubuntu, Debian)
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
- the version number or equivalent code name

Examples:
- Windows - 10
- macOS - Catalina or macOS - 10.15
hoechenberger marked this conversation as resolved.
Show resolved Hide resolved
- Linux - Ubuntu - Bionic Beaver
- Linux - Ubuntu - 18.04.5 LTS
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved

```JSON
The information related to stimulus presentation might be described
in the accompanying JSON sidecar as follows (based on the example of the previous section):

```JSON
{
"trial_type": {
"LongName": "Emotion image type",
Expand All @@ -129,16 +197,18 @@ of example.
"identifier": {
"LongName": "Unique identifier from Karolinska (KDEF) database",
"Description": "ID from KDEF database used to identify the displayed image"
}
},
"StimulusPresentation": {
"OperatingSystem": "Linux-Ubuntu 18.04.5 LTS",
"SoftwareName": "Psychtoolbox",
"SoftwareRRID": "SCR_002881",
"SoftwareVersion": "3.0.14",
"Code": "doi:10.5281/zenodo.3361717"
}
}
```
```

For multi-echo files, the `*_events.tsv` file is applicable to all echos of particular
run:
<!-- Link Definitions -->
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved

```Text
sub-01_task-cuedSGT_run-1_events.tsv
sub-01_task-cuedSGT_run-1_echo-1_bold.nii.gz
sub-01_task-cuedSGT_run-1_echo-2_bold.nii.gz
sub-01_task-cuedSGT_run-1_echo-3_bold.nii.gz
```
[object]: https://www.json.org/json-en.html
[uri]: https://github.com/bids-standard/bids-starter-kit/wiki/Glossary#uri