Skip to main content

Physiology-Informed ECG Delineator Based on Peak Prominence

Project description

Physiology-Informed ECG Delineation Based on Peak Prominence

This Python package implements the Peak Prominence ECG Delineator [1] and provides methods for ECG cleaning and R-peak detection [2], resulting in a complete delineation pipeline. This delineator allows for fast and precise detection of the positions, on- and offsets of morphology waves (e.g., P, R, T) in single or multi-lead ECG signals. An optional multi-lead correction procedure can be applied, leveraging information from all leads if available.

Advantages and Limits

This proposed approach achieves a highly explainable and interpretable wave selection by leveraging prominence information. Hence, wave detection only depends on physiologically motivated parameters chosen so that morphologies of interest are well represented and portrayed, yielding high $F_1$-scores and low errors on established Datasets in comparison to competing methods [1].

NOTE: This approach allows for further customization w.r.t to these parameters so that different parameter choices or other physiologically informed decision rules might result in higher performance or robustness regarding certain morphologies and heartbeat types. Even though, the utilized approach for on- and offset detection yielded great performance it is constrained by typical physiological boundaries. Developing novel prominence computation methods to robustly identify basepoints might therefore yield further improvements.

Installation

You can install the latest version of the prominence-delineator package from the Python Package Index (PyPI) by running:

pip install prominence-delineator

Usage

A complete working example is provided in example.ipynb, additionally the basic usage is depicted below. The ProminenceDelineator takes the sampling_frequency and optionally several physiological parameters as input. Then, R-peaks can be detected using any reliable R-peak detector or with the integrated method (applying the FastNVG [2] approach). Before detecting further waves, the required ECG cleaning can easily be performed by using .clean_ecg(ecg). Finally, morphology waves can be detected using .find_waves() or .find_waves_multilead() for single or multi-lead ECG signals, respectively.

Note: For multi-lead delineation, the ecg and rpeaks input should be in the form of a list or ndarray containing the ECG signals or R-peaks of each lead, respectively. The output will be given as a dictionary with keys denoting the wave type and values lists containing wave positions or lists of wave positions for all leads when processing multi-lead data.

Single Lead ECG Delineation

from prominence_delineator import ProminenceDelineator 

# Create an instance of the ProminenceDelineator
PromDelineator = ProminenceDelineator(sampling_frequency=fs)
# Detect the R-peaks in the ECG signal
rpeaks = PromDelineator.find_rpeaks(ecg)
# Clean the ECG signal
ecg = PromDelineator.clean_ecg(ecg)
# Find waves in the ECG signal using the ProminenceDelineator
waves = PromDelineator.find_waves(ecg, rpeaks=rpeaks)

Delineated ECG

Multi-Lead ECG Delineation

from prominence_delineator import ProminenceDelineator 

# Create an instance of the ProminenceDelineator
PromDelineator = ProminenceDelineator(sampling_frequency=fs)
# Detect the R-peaks in the multilead ECG signal
multilead_rpeaks = PromDelineator.find_rpeaks(ecg_multilead)
# Clean the ECG signal
ecg_multilead = PromDelineator.clean_ecg(ecg_multilead)
# Find waves in the ECG signal using the find_waves function
multilead_waves = PromDelineator.find_waves_multilead(ecg_multilead, rpeaks_multilead=multilead_rpeaks)

References

  • [1] Emrich, J., Gargano, A., Koka, T., and Muma, M. (2024), Physiology-Informed ECG Delineation Based on Peak Prominence.
  • [2] Emrich, J., Koka, T., Wirth, S. and Muma, M. (2023). Accelerated Sample-Accurate R-Peak Detectors Based on Visibility Graphs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prominence_delineator-0.0.7.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

prominence_delineator-0.0.7-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file prominence_delineator-0.0.7.tar.gz.

File metadata

  • Download URL: prominence_delineator-0.0.7.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for prominence_delineator-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b25d05d1fa499b5d287c9174cfb035ff2c857555588e5950e48a91d1100afe59
MD5 b77440ae0232c8ed98ad54e46c2626ed
BLAKE2b-256 44ac1c9eb706d5b21b04000ea46c6b5cbee062cfea71455f1555a49800bbfd8a

See more details on using hashes here.

File details

Details for the file prominence_delineator-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for prominence_delineator-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 559b158a6f04053207a9b76e633f35e6da592021fea6ce7f07c458d223f95534
MD5 52083f58c6616bb87222be7f5f79dd5b
BLAKE2b-256 d47fa6266c0ff9e7146cf8f5a4d13c7ed55d4f266d3b4c3e33d95a809145f58f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page