m3resp.Signal#

class m3resp.Signal(values, time, sample_frequency=None, unit=None, name=None, metadata=<factory>, modality='unknown', category=None, channel=None, source=None, processing_state='raw', derived_from=None, method=None)[source]#

A TimeSeries tagged with modality and provenance context.

Provenance fields (source vs method are distinct and often confused):

  • modality: which device/technique produced this - "eit", "emg", "ventilator". Orthogonal to category.

  • category: what physical quantity these numbers are - an impedance, an airway pressure, a flow. Known aliases are canonicalized via m3resp.data.categories.normalize_category(); an unrecognized value is kept as-is, since the vocabulary is open. None means unspecified.

  • channel: which physical/logical channel this is (e.g. an EMG lead name, "global_impedance" for EIT).

  • source: where the data came from - the upstream producer/origin, typically the loader or library that emitted it (e.g. "resurfemg", "eitprocessing"). Provenance of origin, not of transformation.

  • method: what was done to it - the specific algorithm/function that produced this particular signal (e.g. "resurfemg.postprocessing.moving_baseline"). This is what distinguishes two signals sharing the same channel and processing_state (e.g. two differently-filtered variants).

  • processing_state: how far along the raw -> intermediate -> processed workflow this signal is, or "derived" if computed from another signal. See ProcessingState.

  • derived_from: for a "derived" signal, the processing_state it was computed from (e.g. a baseline derived from the "processed" envelope has derived_from="processed"). None otherwise.

Methods

to_manifest_row

Lightweight, JSON-serializable metadata row (no raw sample arrays).

Attributes

Parameters:
  • values (ndarray)

  • time (ndarray)

  • sample_frequency (float | None)

  • unit (str | None)

  • name (str | None)

  • metadata (dict[str, Any])

  • modality (Literal['eit', 'emg', 'ventilator', 'monitor', 'unknown'] | str)

  • category (Literal['impedance', 'electrical_potential', 'airway_pressure', 'esophageal_pressure', 'gastric_pressure', 'transpulmonary_pressure', 'airflow', 'volume', 'tidal_volume'] | str | None)

  • channel (str | None)

  • source (str | None)

  • processing_state (Literal['raw', 'intermediate', 'processed', 'derived'])

  • derived_from (Literal['raw', 'intermediate', 'processed', 'derived'] | None)

  • method (str | None)

category: Literal['impedance', 'electrical_potential', 'airway_pressure', 'esophageal_pressure', 'gastric_pressure', 'transpulmonary_pressure', 'airflow', 'volume', 'tidal_volume'] | str | None = None#
channel: str | None = None#
derived_from: Literal['raw', 'intermediate', 'processed', 'derived'] | None = None#
method: str | None = None#
modality: Literal['eit', 'emg', 'ventilator', 'monitor', 'unknown'] | str = 'unknown'#
processing_state: Literal['raw', 'intermediate', 'processed', 'derived'] = 'raw'#
source: str | None = None#
to_manifest_row()[source]#

Lightweight, JSON-serializable metadata row (no raw sample arrays).

Matches the data model doc’s separation of raw arrays (kept in files) from relational/manifest metadata (Sec 8): a signals_manifest.csv/.json row should describe a stream, not embed it.

Return type:

dict[str, object]

Tutorials that use Signal#

Process an EIT recording

Process an EIT recording

Process an EMG recording

Process an EMG recording