annotations
Reading the annotations of an EDF+ recording.
EDF+ keeps annotations in "EDF Annotations" signals inside the data records,
as Time-stamped Annotation Lists (TALs): +onset<0x15>duration<0x14>text<0x14><0x00>.
Annotation text is mapped onto the platform's event labels; text that matches
none is kept as it was written.
EDF_ANNOTATIONS_LABEL = 'EDF Annotations'
module-attribute
¶
The label EDF+ gives a signal that holds annotations rather than samples.
MAX_ANNOTATION_SECONDS = 30 * 24 * 3600
module-attribute
¶
Annotations per second of recording after which parsing stops; at least 100 are always read.
SeekableReadable
¶
parse_edf_annotations(readable, n_signals, n_records, record_duration_seconds, samples_per_record, annotation_signal_indices)
¶
Read the annotations of an EDF+ recording's data records.
Only the annotation signals are read: the reader seeks past every other
signal. Parsing stops once :data:MAX_ANNOTATION_DENSITY annotations per
second of recording have been read, and never before 100.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
readable
|
SeekableReadable
|
The recording, positioned at the start of its data records. |
required |
n_signals
|
int
|
The number of signals, annotation signals included. |
required |
n_records
|
int
|
The number of data records. |
required |
record_duration_seconds
|
float
|
The duration of one data record. |
required |
samples_per_record
|
list[int]
|
Each signal's samples per data record. |
required |
annotation_signal_indices
|
list[int]
|
The indices of the annotation signals. |
required |
Returns:
| Type | Description |
|---|---|
list[tuple[int, int, str, str | None]]
|
|
list[tuple[int, int, str, str | None]]
|
onset is at least 0 and at most :data: |
list[tuple[int, int, str, str | None]]
|
its duration capped at the same. |
list[tuple[int, int, str, str | None]]
|
|
list[tuple[int, int, str, str | None]]
|
matched, else None. |