m3resp.Event#

class m3resp.Event(name, modality, time, id=<factory>, sample_index=None, signal_name=None, sample_frequency=None, label=None, confidence=None, metadata=<factory>)[source]#

A timestamped event from one modality.

Variables:
  • name (str) – What kind of event this is, e.g. 'arterial_blood_gas_draw' or 'baydur_maneuver'.

  • modality (str) – The device or technique the event came from, e.g. 'ventilator' or 'eit'.

  • time (float) – Time at which the event occurred, in seconds on the recording’s time axis or the shared clock after alignment.

  • id (str) – Random identifier, generated automatically. It stays the same when the event is shifted onto a common clock and when it is saved to a dictionary and read back. Results can use it to point at this event through ParameterResult.event_id. Two events that differ only in id count as equal.

  • sample_index (int | None) – Position of this event in the signal it was detected in. Only meaningful together with signal_name and sample_frequency, which say which signal and time axis it is relative to - a modality can have multiple signals at different sampling rates, so sample_index alone is ambiguous. None when the event wasn’t derived from indexing into a signal.

  • signal_name (str | None) – Which signal sample_index refers to. None when the event wasn’t derived from indexing into a signal.

  • sample_frequency (float | None) – Sampling rate of that signal, in Hz. None when the event wasn’t derived from indexing into a signal.

  • label (str | None) – Optional free-text note that tells this occurrence apart from others of the same kind, e.g. name='arterial_blood_gas_draw' with label='before PEEP step 2'.

  • confidence (float | None) – Optional measure of how sure the detector was.

  • metadata (dict[str, Any]) – Optional extra information about the event.

Parameters:

Attributes

confidence: float | None = None#
id: str#
label: str | None = None#
metadata: dict[str, Any]#
modality: str#
name: str#
sample_frequency: float | None = None#
sample_index: int | None = None#
signal_name: str | None = None#
time: float#