Skip to content

raj-open/herz

Repository files navigation

Python version: 3.10, 3.11 Code style: black

Pressure-Volume analysis (RV) for cardiology

This repository contains that analysis time-series data for pressure and volume (right-ventricular measurements). This involves:

  • automatic recognition of cycles
  • fitting/re-fitting of models
  • automatic recognition of 'special points' (of physical interest)
  • automatic matching of the pressure and volume series
  • output of tables and plots (individual time-series and P-V plots).

The code handles unit conversions (input -> internal usage -> outputs) robustly using the python package pint.

Examples and technical notes

See examples and notes.

System requirements

Windows users

Windows users are encouraged to install bash. There are a few ways to do this:

  1. Install git for windows (which includes bash).
  2. Activate ubuntu. This is perhaps more standard, but more complicated.

To install the Justfile tool you may need to install chocolatey or scoop. And then install the tool via these (see https://github.com/casey/just#installation).

Usage

All bash commands are to be run from the root folder of this repository.

  1. Initialisation (only needed once) Open a bash terminal and execute

    just build

    If there are any errors, run this once more. If this still persists, contact the maintainer.

  2. Add your Data e.g. to the data folder.

  3. Configuration:

    • Adjust the file setup/config.yaml.
    • If this does not exist, copy the file form templates/templates-config.yaml to setup/config.yaml.
    • Ensure in particular that the paths to the input and output data are set correctly.
    • For the output plots choose *.html format for dynamical output, otherwise choose *.png (lossless).
  4. Either

    • (interactive) open notebooks/main.ipynb and run all cells; or

    • (non-interactive) execute in a bash terminal

      just run

Clean state

If there are issues, it often helps to restore things to a fresh state. To do this for your local copy of the repository, run

just clean

NOTE: After running this, you will need to run just build before executing the code again.

If you just wish to obtain a fresh state for the notebooks, run

just clean-notebooks

Development

See CONTRIBUTING.md.

References

The structure of the code in this repository is entirely the work of the owner. Some methods in this repository (e.g. the automatic recognition of cycles) are in part inspired by literature, e.g. 1. The remaining methods (esp. polynomial fitting methods) and corresponding code in this repository was developed independently by the repository owner.

Footnotes

  1. Heerdt, Paul M et al. "A pressure-based single beat method for estimation of right ventricular ejection fraction: proof of concept." The European respiratory journal vol. 55,3 1901635. 12 Mar. 2020, doi:10.1183/13993003.01635-2019

About

Computations for pressure-volume data series arising in cardiology.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published