m3resp.ParameterResult#

class m3resp.ParameterResult(name, value, modality, category=None, unit=None, metric_type=None, breath_id=None, breath_ids=None, event_id=None, start_time=None, end_time=None, region=None, channel=None, method=None, metadata=<factory>)[source]#

A named, unit-tagged metric produced by a processing step.

A parameter can be scoped to whichever of these apply. All are optional and can be combined (e.g. one metric per breath within a time period), except breath_id with breath_ids, which raises ValueError:

  • a single breath (breath_id);

  • multiple breaths, e.g. a metric computed over a rolling window of breaths (breath_ids);

  • a single timepoint (start_time set, end_time left None);

  • a time period, e.g. during an intervention or one 30-second window (start_time and end_time both set) - these are single values on one instance, not a list, so repeated windows are one instance each;

  • a specific m3resp.data.events.Event (event_id), e.g. a blood-gas draw used for a P/F ratio, or a labeled intervention like a Baydur maneuver;

  • the whole signal, when none of the above are set.

name stays a free-form, human-readable label. metric_type is the standardized metric this instance represents, used to group/compare across runs regardless of what a step happened to call it: it’s auto-derived from name via m3resp.data.metrics.normalize_metric_name() when left unset, and stays None for a custom name that isn’t a known standard metric (so nothing is mislabelled). Pass metric_type explicitly to override the derivation.

modality names the device/technique this metric came from; category names the physical quantity it is derived from (see m3resp.data.categories). They are independent axes - a Pocc pressure-time product is modality="ventilator", category="airway_pressure".

unit is normalized via m3resp.data.units.normalize_unit().

Methods

to_dict

JSON-serializable representation (value becomes a list if array).

Attributes

Parameters:
breath_id: str | None = None#
breath_ids: list[str] | None = None#
category: str | None = None#
channel: str | None = None#
end_time: float | None = None#
event_id: str | None = None#
property is_scalar: bool#

Whether value is a single number rather than an array.

metadata: dict[str, Any]#
method: str | None = None#
metric_type: str | None = None#
modality: str#
name: str#
region: str | None = None#
start_time: float | None = None#
to_dict()[source]#

JSON-serializable representation (value becomes a list if array).

Return type:

dict[str, Any]

unit: str | None = None#
value: float | ndarray#

Tutorials that use ParameterResult#

Process an EIT recording

Process an EIT recording

Process an EMG recording

Process an EMG recording