Public API#
This page lists the classes and functions that you import from m3resp. Each name links to a page with its arguments, its return value and the units. The page of a class or function also lists the tutorials that use it.
See the Concepts for what the objects mean.
Sessions and workflows#
An M3Session holds the recordings and the results of one analysis. The presets and the workflow functions run the processing steps.
Recordings, processing results and provenance for a multimodal study session. |
|
A named preset that runs a fixed sequence of M3Session methods. |
|
Preprocess loaded EIT data and store its detected breaths. |
|
Preprocess loaded EMG, remove ECG, detect breaths and calculate features. |
|
Set recording start times and align detected breaths across modalities. |
|
Results, timing and execution records for one workflow run. |
|
Return the names of all registered presets, sorted. |
|
Return the Preset class registered under name. |
|
Store preset_cls under name, replacing any existing registration. |
|
Load a workflow from an object, dictionary or YAML/JSON file. |
|
Run a workflow's ordered steps and return their results and records. |
|
Run a workflow file, write its manifest and apply its export settings. |
|
Return a mapping of registered step name -> one-line summary. |
|
Register a function and its workflow inputs, outputs and descriptions. |
|
An ordered workflow description with inputs, settings and export options. |
|
One operation and its input, parameter and output bindings. |
|
Structural diagnostics and optional checks for running a workflow locally. |
|
An ordered description of workflow steps with resolved settings. |
|
Discover workflow steps, inspect specs and run workflows for an application. |
|
Collect structural errors and warnings for all resolvable workflow steps. |
|
Validate a workflow and resolve the settings needed to run its steps. |
|
Check workflow structure and optionally its readiness on this machine. |
|
Check workflow structure and raise for its first error. |
Signals, results and quality#
These objects hold the processed signals, the calculated parameters, the quality checks and the record of each processing step.
A value array paired with its time axis. |
|
A |
|
An ordered collection of Signal objects, queryable by modality. |
|
Return a copy of signal with its values at the time points time. |
|
A named, unit-tagged metric produced by a processing step. |
|
An ordered collection of ParameterResult objects. |
|
The outcome of one quality check against a signal, breath, or run. |
|
An ordered collection of QualityFlag results. |
|
A record of one executed processing operation. |
|
An ordered log of |
Events and synchronization#
These objects and functions hold breaths, events and values per breath, and put the recordings on one clock.
A timestamped event from one modality. |
|
A stretch of time from one modality, with a start and an end. |
|
One breath from one modality, with a signal turning point. |
|
One value for each event, in the same order as the events. |
|
One value for each interval, in the same order as the intervals. |
|
An ordered collection of results with values per interval or breath. |
|
One number for each pixel of an EIT image. |
|
Which pixels of an EIT image belong to a region. |
|
An ordered collection of pixel masks, such as lung-space masks. |
|
Return the breaths of one pixel as |
|
One physiological breath, matched across any number of modalities. |
|
Convert one timestamped event into an |
|
Convert an iterable of events into a list of |
|
Convert one timed interval into an |
|
Convert an iterable of intervals into a list of |
|
Convert one detected breath into a |
|
Convert an iterable of breaths into a list of |
|
Return the fields of an event, interval or breath as a dictionary. |
|
Convert absolute per-device start timestamps into manual offsets (plan_stage2.md Sec 20, "timestamp alignment"). |
|
Group breaths across modalities by their timing in seconds. |
Data model#
The data model is a set of checked records of a finished analysis. See Provenance and processing history.
Opaque grouping of sessions belonging to one external study subject. |
|
Time-stamped intervention or notable occurrence (doc Sec 7.9). |
|
A physical file holding raw/processed/derived data (doc Sec 8.1). |
|
Store a session's recordings, results and processing provenance. |
|
A dict-of-id-to-entity table per entity type, plus relational lookups. |
|
A quantitative result computed from one or more source streams (doc Sec 7.11). |
|
Physical or software system that produces data (doc Sec 7.3). |
|
A stored record of a workflow, processing step or session action. |
|
Polymorphic quality label (doc Sec 11). |
|
One continuous acquisition period (doc Sec 7.2). |
|
Base type for every continuous signal (doc Sec 7.4). |
|
Write one JSON file per table to |
|
Return a list of readable problem descriptions (empty if none found). |
Export#
This function writes the results of a session to CSV, JSON and array files.
Write session summaries, result tables and array archives. |
Load a recording#
These functions load one recording without a session.
Load an EIT recording through the EIT adapter. |
|
Load an EMG recording through the EMG adapter (ReSurfEMGAdapter by default). |
Plots#
These functions make figures with Matplotlib.
Plot the results of the EIT processing of a session. |
|
Plot the loaded EIT signal and the processed EMG signals of a session. |
|
Plot each signal before and after synchronization. |
Synthetic data#
These classes and functions make synthetic EIT, EMG and ventilator recordings for tests and examples.
Top-level configuration for a synthetic multimodal dataset. |
|
Generated multimodal dataset. |
|
Generated signal plus metadata and export paths. |
|
Shared respiratory timing and occlusion settings. |
|
Synthetic EIT signal and Draeger export settings. |
|
Synthetic EMG settings passed to ReSurfEMG. |
|
Synthetic ventilator settings passed to ReSurfEMG. |
|
Generate synthetic EIT, EMG, and ventilator data from one configuration. |
|
Generate a realistic synthetic breathing-related impedance waveform. |
|
Load a synthetic generator configuration from a YAML file. |