Skip to content

Commit 8b53807

Browse files
tsalosappelhoff
andauthored
[ENH] Standardize and organize entity descriptions (#1264)
* Standardize and organize entity descriptions. * Incorporate info about task variability. * Apply suggestions from code review Co-authored-by: Stefan Appelhoff <[email protected]> Co-authored-by: Stefan Appelhoff <[email protected]>
1 parent 583674b commit 8b53807

File tree

1 file changed

+118
-92
lines changed

1 file changed

+118
-92
lines changed

src/schema/objects/entities.yaml

Lines changed: 118 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ acquisition:
77
name: acq
88
display_name: Acquisition
99
description: |
10-
The `acq-<label>` entity corresponds to a custom label the
11-
user MAY use to distinguish a different set of parameters used for
12-
acquiring the same modality.
13-
For example this should be used when a study includes two T1w images - one
14-
full brain low resolution and one restricted field of view but high
15-
resolution.
10+
The `acq-<label>` entity corresponds to a custom label the user MAY use to distinguish
11+
a different set of parameters used for acquiring the same modality.
12+
13+
For example, this should be used when a study includes two T1w images -
14+
one full brain low resolution and one restricted field of view but high resolution.
1615
In such case two files could have the following names:
17-
`sub-01_acq-highres_T1w.nii.gz` and `sub-01_acq-lowres_T1w.nii.gz`, however
18-
the user is free to choose any other label than `highres` and `lowres` as long
16+
`sub-01_acq-highres_T1w.nii.gz` and `sub-01_acq-lowres_T1w.nii.gz`;
17+
however, the user is free to choose any other label than `highres` and `lowres` as long
1918
as they are consistent across subjects and sessions.
19+
2020
In case different sequences are used to record the same modality
2121
(for example, `RARE` and `FLASH` for T1w)
2222
this field can also be used to make that distinction.
23-
At what level of detail to make the distinction (for example,
24-
just between `RARE` and `FLASH`, or between `RARE`, `FLASH`, and `FLASHsubsampled`)
23+
The level of detail at which the distinction is made
24+
(for example, just between `RARE` and `FLASH`, or between `RARE`, `FLASH`, and `FLASHsubsampled`)
2525
remains at the discretion of the researcher.
2626
type: string
2727
format: label
@@ -39,29 +39,32 @@ ceagent:
3939
name: ce
4040
display_name: Contrast Enhancing Agent
4141
description: |
42-
The `ce-<label>` entity can be used to distinguish
43-
sequences using different contrast enhanced images.
42+
The `ce-<label>` entity can be used to distinguish sequences using different contrast enhanced images.
4443
The label is the name of the contrast agent.
45-
The key `"ContrastBolusIngredient"` MAY also be added in the JSON file,
46-
with the same label.
44+
45+
This entity represents the `"ContrastBolusIngredient"` metadata field.
46+
Therefore, if the `ce-<label>` entity is present in a filename,
47+
`"ContrastBolusIngredient"` MAY also be added in the JSON file, with the same label.
4748
type: string
4849
format: label
4950
chunk:
5051
name: chunk
5152
display_name: Chunk
5253
description: |
53-
The `chunk-<index>` key/value pair is used to distinguish between different
54-
regions, 2D images or 3D volumes files, of the same physical sample with
55-
different fields of view acquired in the same imaging experiment.
54+
The `chunk-<index>` key/value pair is used to distinguish between different regions,
55+
2D images or 3D volumes files,
56+
of the same physical sample with different fields of view acquired in the same imaging experiment.
5657
type: string
5758
format: index
5859
density:
5960
name: den
6061
display_name: Density
6162
description: |
6263
Density of non-parametric surfaces.
63-
MUST have a corresponding `Density` metadata field to provide
64-
interpretation.
64+
65+
This entity represents the `"Density"` metadata field.
66+
Therefore, if the `den-<label>` entity is present in a filename,
67+
`"Density"` MUST also be added in the JSON file, to provide interpretation.
6568
6669
This entity is only applicable to derivative data.
6770
type: string
@@ -71,7 +74,7 @@ description:
7174
display_name: Description
7275
description: |
7376
When necessary to distinguish two files that do not otherwise have a
74-
distinguishing entity, the `_desc-<label>` entity SHOULD be used.
77+
distinguishing entity, the `desc-<label>` entity SHOULD be used.
7578
7679
This entity is only applicable to derivative data.
7780
type: string
@@ -81,21 +84,27 @@ direction:
8184
display_name: Phase-Encoding Direction
8285
description: |
8386
The `dir-<label>` entity can be set to an arbitrary alphanumeric label
84-
(for example, `dir-LR` or `dir-AP`) to distinguish different phase-encoding
85-
directions.
87+
(for example, `dir-LR` or `dir-AP`)
88+
to distinguish different phase-encoding directions.
89+
90+
This entity represents the `"PhaseEncodingDirection"` metadata field.
91+
Therefore, if the `dir-<label>` entity is present in a filename,
92+
`"PhaseEncodingDirection"` MUST be defined in the associated metadata.
93+
Please note that the `<label>` does not need to match the actual value of the field.
8694
type: string
8795
format: label
8896
echo:
8997
name: echo
9098
display_name: Echo
9199
description: |
92100
If files belonging to an entity-linked file collection are acquired at different
93-
echo times, the `_echo-<index>` entity MUST be used to distinguish
94-
individual files.
95-
This entity represents the `"EchoTime"` metadata field. Please note that the `<index>`
96-
denotes the number/index (in the form of a nonnegative integer), not the
97-
`"EchoTime"` value which needs to be stored in the field `"EchoTime"` of the separate
98-
JSON file.
101+
echo times, the `echo-<index>` entity MUST be used to distinguish individual files.
102+
103+
This entity represents the `"EchoTime"` metadata field.
104+
Therefore, if the `echo-<index>` entity is present in a filename,
105+
`"EchoTime"` MUST be defined in the associated metadata.
106+
Please note that the `<index>` denotes the number/index (in the form of a nonnegative integer),
107+
not the `"EchoTime"` value of the separate JSON file.
99108
type: string
100109
format: index
101110
flip:
@@ -105,9 +114,12 @@ flip:
105114
If files belonging to an entity-linked file collection are acquired at different
106115
flip angles, the `_flip-<index>` entity pair MUST be used to distinguish
107116
individual files.
108-
This entity represents the `"FlipAngle"` metadata field. Please note that the `<index>`
109-
denotes the number/index (in the form of a nonnegative integer), not the `"FlipAngle"`
110-
value which needs to be stored in the field `"FlipAngle"` of the separate JSON file.
117+
118+
This entity represents the `"FlipAngle"` metadata field.
119+
Therefore, if the `flip-<index>` entity is present in a filename,
120+
`"FlipAngle"` MUST be defined in the associated metadata.
121+
Please note that the `<index>` denotes the number/index (in the form of a nonnegative integer),
122+
not the `"FlipAngle"` value of the separate JSON file.
111123
type: string
112124
format: index
113125
hemisphere:
@@ -126,12 +138,14 @@ inversion:
126138
name: inv
127139
display_name: Inversion Time
128140
description: |
129-
If files belonging to an entity-linked file collection are acquired at different
130-
inversion times, the `_inv-<index>` entity MUST be used to distinguish
131-
individual files.
132-
This entity represents the `"InversionTime` metadata field. Please note that the `<index>`
133-
denotes the number/index (in the form of a nonnegative integer), not the `"InversionTime"`
134-
value which needs to be stored in the field `"InversionTime"` of the separate JSON file.
141+
If files belonging to an entity-linked file collection are acquired at different inversion times,
142+
the `inv-<index>` entity MUST be used to distinguish individual files.
143+
144+
This entity represents the `"InversionTime` metadata field.
145+
Therefore, if the `inv-<index>` entity is present in a filename,
146+
`"InversionTime"` MUST be defined in the associated metadata.
147+
Please note that the `<index>` denotes the number/index (in the form of a nonnegative integer),
148+
not the `"InversionTime"` value of the separate JSON file.
135149
type: string
136150
format: index
137151
label:
@@ -161,9 +175,12 @@ mtransfer:
161175
If files belonging to an entity-linked file collection are acquired at different
162176
magnetization transfer (MT) states, the `_mt-<label>` entity MUST be used to
163177
distinguish individual files.
164-
This entity represents the `"MTState"` metadata field. Allowed label values for this
165-
entity are `on` and `off`, for images acquired in presence and absence of an MT pulse,
166-
respectively.
178+
179+
This entity represents the `"MTState"` metadata field.
180+
Therefore, if the `mt-<label>` entity is present in a filename,
181+
`"MTState"` MUST be defined in the associated metadata.
182+
Allowed label values for this entity are `on` and `off`,
183+
for images acquired in presence and absence of an MT pulse, respectively.
167184
type: string
168185
enum:
169186
- 'on'
@@ -210,28 +227,30 @@ reconstruction:
210227
name: rec
211228
display_name: Reconstruction
212229
description: |
213-
The `rec-<label>` entity can be used to distinguish
214-
different reconstruction algorithms (for example `MoCo` for the ones using motion
215-
correction).
230+
The `rec-<label>` entity can be used to distinguish different reconstruction algorithms
231+
(for example, `MoCo` for the ones using motion correction).
216232
type: string
217233
format: label
218234
recording:
219235
name: recording
220236
display_name: Recording
221237
description: |
222-
More than one continuous recording file can be included (with different
223-
sampling frequencies).
224-
In such case use different labels.
225-
For example: `_recording-contrast`, `_recording-saturation`.
238+
The `recording-<label>` entity can be used to distinguish continuous recording files.
239+
240+
This entity is commonly applied when continuous recordings have different sampling frequencies or start times.
241+
For example, physiological recordings with different sampling frequencies may be distinguished using
242+
labels like `recording-100Hz` and `recording-500Hz`.
226243
type: string
227244
format: label
228245
resolution:
229246
name: res
230247
display_name: Resolution
231248
description: |
232249
Resolution of regularly sampled N-dimensional data.
233-
MUST have a corresponding `"Resolution"` metadata field to provide
234-
interpretation.
250+
251+
This entity represents the `"Resolution"` metadata field.
252+
Therefore, if the `res-<label>` entity is present in a filename,
253+
`"Resolution"` MUST also be added in the JSON file, to provide interpretation.
235254
236255
This entity is only applicable to derivative data.
237256
type: string
@@ -240,11 +259,14 @@ run:
240259
name: run
241260
display_name: Run
242261
description: |
262+
The `run-<index>` entity is used to distinguish separate data acquisitions with the same acquisition parameters
263+
and (other) entities.
264+
243265
If several data acquisitions (for example, MRI scans or EEG recordings)
244266
with the same acquisition parameters are acquired in the same session,
245267
they MUST be indexed with the [`run-<index>`](../99-appendices/09-entities.md#run) entity:
246-
`_run-1`, `_run-2`, `_run-3`, and so on (only nonnegative integers are allowed as
247-
run labels).
268+
`_run-1`, `_run-2`, `_run-3`, and so on
269+
(only nonnegative integers are allowed as run indices).
248270
249271
If different entities apply,
250272
such as a different session indicated by [`ses-<label>`](../99-appendices/09-entities.md#ses),
@@ -257,29 +279,25 @@ sample:
257279
name: sample
258280
display_name: Sample
259281
description: |
260-
A sample pertaining to a subject such as tissue, primary cell
261-
or cell-free sample.
262-
The `sample-<label>` entity is used to distinguish between different
263-
samples from the same subject.
264-
The label MUST be unique per subject and is RECOMMENDED to be unique
265-
throughout the dataset.
282+
A sample pertaining to a subject such as tissue, primary cell or cell-free sample.
283+
The `sample-<label>` entity is used to distinguish between different samples from the same subject.
284+
The label MUST be unique per subject and is RECOMMENDED to be unique throughout the dataset.
266285
type: string
267286
format: label
268287
session:
269288
name: ses
270289
display_name: Session
271290
description: |
272-
A logical grouping of neuroimaging and behavioral data consistent across
273-
subjects.
274-
Session can (but doesn't have to) be synonymous to a visit in a
275-
longitudinal study.
291+
A logical grouping of neuroimaging and behavioral data consistent across subjects.
292+
Session can (but doesn't have to) be synonymous to a visit in a longitudinal study.
276293
In general, subjects will stay in the scanner during one session.
277294
However, for example, if a subject has to leave the scanner room and then
278295
be re-positioned on the scanner bed, the set of MRI acquisitions will still
279296
be considered as a session and match sessions acquired in other subjects.
280297
Similarly, in situations where different data types are obtained over
281298
several visits (for example fMRI on one day followed by DWI the day after)
282299
those can be grouped in one session.
300+
283301
Defining multiple sessions is appropriate when several identical or similar
284302
data acquisitions are planned and performed on all -or most- subjects,
285303
often in the case of some intervention between sessions
@@ -290,40 +308,37 @@ space:
290308
name: space
291309
display_name: Space
292310
description: |
293-
The space entity can be used to indicate
294-
the way in which electrode positions are interpreted
295-
(for EEG/MEG/iEEG data) or
296-
the spatial reference to which a file has been aligned (for MRI data).
297-
The space `<label>` MUST be taken from one of the modality specific lists in
311+
The `space-<label>` entity can be used to indicate the way in which electrode positions are interpreted
312+
(for EEG/MEG/iEEG data)
313+
or the spatial reference to which a file has been aligned (for MRI data).
314+
The `<label>` MUST be taken from one of the modality specific lists in
298315
[Appendix VIII](../99-appendices/08-coordinate-systems.md).
299-
For example for iEEG data, the restricted keywords listed under
300-
[iEEG Specific Coordinate Systems](../99-appendices/08-coordinate-systems.md#ieeg-specific-coordinate-systems)
316+
For example, for iEEG data, the restricted keywords listed under
317+
[iEEG-Specific Coordinate Systems](../99-appendices/08-coordinate-systems.md#ieeg-specific-coordinate-systems)
301318
are acceptable for `<label>`.
302319
303-
For EEG/MEG/iEEG data, this entity can be applied to raw data, but
304-
for other data types, it is restricted to derivative data.
320+
For EEG/MEG/iEEG data, this entity can be applied to raw data,
321+
but for other data types, it is restricted to derivative data.
305322
type: string
306323
format: label
307324
split:
308325
name: split
309326
display_name: Split
310327
description: |
311-
In the case of long data recordings that exceed a file size of 2Gb, the
312-
.fif files are conventionally split into multiple parts.
328+
In the case of long data recordings that exceed a file size of 2Gb,
329+
`.fif` files are conventionally split into multiple parts.
313330
Each of these files has an internal pointer to the next file.
314-
This is important when renaming these split recordings to the BIDS
315-
convention.
331+
This is important when renaming these split recordings to the BIDS convention.
316332
317333
Instead of a simple renaming, files should be read in and saved under their
318334
new names with dedicated tools like [MNE-Python](https://mne.tools/),
319-
which will ensure that not only the file names, but also the internal file
320-
pointers will be updated.
321-
It is RECOMMENDED that .fif files with multiple parts use the
322-
`split-<index>` entity to indicate each part.
335+
which will ensure that not only the file names, but also the internal file pointers, will be updated.
336+
337+
It is RECOMMENDED that `.fif` files with multiple parts use the `split-<index>` entity to indicate each part.
323338
If there are multiple parts of a recording and the optional `scans.tsv` is provided,
324-
remember to list all files separately in `scans.tsv` and that the entries for the
325-
`acq_time` column in `scans.tsv` MUST all be identical, as described in
326-
[Scans file](../03-modality-agnostic-files.md#scans-file).
339+
all files MUST be listed separately in `scans.tsv` and
340+
the entries for the `acq_time` column in `scans.tsv` MUST all be identical,
341+
as described in [Scans file](../03-modality-agnostic-files.md#scans-file).
327342
type: string
328343
format: index
329344
stain:
@@ -332,10 +347,14 @@ stain:
332347
description: |
333348
The `stain-<label>` key/pair values can be used to distinguish image files
334349
from the same sample using different stains or antibodies for contrast enhancement.
335-
Stains SHOULD be indicated in the `"SampleStaining"` key in the sidecar JSON file,
350+
351+
This entity represents the `"SampleStaining"` metadata field.
352+
Therefore, if the `stain-<label>` entity is present in a filename,
353+
`"SampleStaining"` SHOULD be defined in the associated metadata,
336354
although the label may be different.
337-
Description of antibodies SHOULD also be indicated in `"SamplePrimaryAntibodies"`
338-
and/or `"SampleSecondaryAntobodies"` as appropriate.
355+
356+
Descriptions of antibodies SHOULD also be indicated in the `"SamplePrimaryAntibodies"`
357+
and/or `"SampleSecondaryAntobodies"` metadata fields, as appropriate.
339358
type: string
340359
format: label
341360
subject:
@@ -351,29 +370,36 @@ task:
351370
description: |
352371
A set of structured activities performed by the participant.
353372
Tasks are usually accompanied by stimuli and responses, and can greatly vary in complexity.
354-
For the purpose of this specification we consider the so-called "resting state" a task,
355-
although events files are not expected for resting state data.
356-
Additionally, a common convention in the specification is to include the word "rest" in
357-
the `task` label for resting state files (for example, `task-rest`).
358373
359374
In the context of brain scanning, a task is always tied to one data acquisition.
360375
Therefore, even if during one acquisition the subject performed multiple conceptually different behaviors
361376
(with different sets of instructions) they will be considered one (combined) task.
377+
378+
While tasks may be repeated across multiple acquisitions,
379+
a given task may have different sets of stimuli (for example, randomized order) and participant responses
380+
across subjects, sessions, and runs.
381+
362382
The `task-<label>` MUST be consistent across subjects and sessions.
363383
364384
Files with the `task-<label>` entity SHOULD have an associated
365385
[events file](SPEC_ROOT/04-modality-specific-files/05-task-events.md#task-events),
366386
as well as certain metadata fields in the associated JSON file.
367387
388+
For the purpose of this specification we consider the so-called "resting state" a task,
389+
although events files are not expected for resting state data.
390+
Additionally, a common convention in the specification is to include the word "rest" in
391+
the `task` label for resting state files (for example, `task-rest`).
368392
type: string
369393
format: label
370394
tracer:
371395
name: trc
372396
display_name: Tracer
373397
description: |
374-
The `trc-<label>` entity can be used to distinguish
375-
sequences using different tracers.
376-
The key `"TracerName"` MUST also be included in the associated JSON file,
377-
although the label may be different.
398+
The `trc-<label>` entity can be used to distinguish sequences using different tracers.
399+
400+
This entity represents the `"TracerName"` metadata field.
401+
Therefore, if the `trc-<label>` entity is present in a filename,
402+
`"TracerName"` MUST be defined in the associated metadata.
403+
Please note that the `<label>` does not need to match the actual value of the field.
378404
type: string
379405
format: label

0 commit comments

Comments
 (0)