Source code for brainaccess.core.annotation

import ctypes


[docs] class Annotation(ctypes.Structure): """A text label attached to a position in the EEG stream. Annotations mark events, such as a stimulus, so that they can be aligned with the EEG data. Returned by :meth:`~brainaccess.core.eeg_manager.EEGManager.get_annotations`. Attributes ---------- timestamp : int Sample number of the annotated position, counted from 0 at the start of the stream. It is not a time: divide by the sample rate (Hz) to get seconds since the stream start. annotation : str The annotation text. """ _fields_ = [ ("timestamp", ctypes.c_size_t), ("_annotation", ctypes.c_char_p), ] @property
[docs] def annotation(self): """The annotation text.""" return self._annotation.decode("utf-8", errors="replace")