Skip to main content

A toolbox for plotting and interactively labeling vital data.

Project description

vitabel: a toolbox for interactively annotating and labeling vital data

In a nutshell, the vitabel package allows loading, processing, and annotating vital data (e.g., medical time-series data e.g. from defibrillators, anesthesia charts or critical care) interactively in a Jupyter notebook.

vitabel annotation screenshot

Installation and Usage

The latest stable release of vitabel is distributed via PyPI and can be installed via

$ pip install vitabel

The latest development version can be installed from the main branch on GitHub by running

$ pip install git+https://github.com/UniGrazMath/vitabel.git

The main feature of vitabel, interactive plots that can be used to annotate data, is designed to work in Jupyter notebooks. Start a new server by running jupyter notebook (or create a new notebook in an existing server), then import the central Vitals class that acts as a container for the vital data. A set of data can be added using, for example, the Vitals.add_defibrillator_recording method, or Vitals.add_vital_db_recording; various output formats of defibrillators and VitalDB are supported.

A typical use of this package reads as follows:

from vitabel import Vitals, Label

# create case and load data
case = Vitals()
case.add_defibrillator_recording("path/to/ZOLL_data_file.json")

# use in-built methods for processing available data, compute etco2
# and predict circulatory state
case.compute_etco2_and_ventilations()
case.predict_circulation()

# create a new label for ROSC events
ROSC_label = Label('ROSC', plotstyle={'marker': '$\u2665$', 'color': 'red', 'ms': 10, 'linestyle': ''})
case.add_global_label(ROSC_label)

# display an interactive plot that allows annotations and further data adjustments
case.plot_interactive(
    channels=[['cpr_acceleration'], ['capnography'], ['ecg_pads'], []],
    labels = [['ROSC'], ['etco2_from_capnography', 'ROSC'], ['ROSC'], ['ROSC', 'rosc_probability']],
    channel_overviews=[['cpr_acceleration']],
    time_unit='s',
    subplots_kwargs={'figsize': (22, 9)}
)

More detailed explicit examples (including the required test data) are contained in the examples directory.

Development

Setup a development environment by using the Python project and environment management tool uv. To setup the environment, simply run

uv sync

Package tests are contained in the tests directory; run them locally via

uv run pytest

We use ruff for linting and formatting the code base, and semantic versioning for the release tags.

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

vitabel-0.0.1.tar.gz (18.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vitabel-0.0.1-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file vitabel-0.0.1.tar.gz.

File metadata

  • Download URL: vitabel-0.0.1.tar.gz
  • Upload date:
  • Size: 18.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.20

File hashes

Hashes for vitabel-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1b74006a5c85763e7d2698786d30e74eba178930baa8af246e7fce5a4da82c19
MD5 6eb540f60c4d978106621f6010e00d21
BLAKE2b-256 d97d0e0ccc3a9d74785e60e79b3f3a1b17c08842ab554f2413f8126a19bca42c

See more details on using hashes here.

File details

Details for the file vitabel-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: vitabel-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.20

File hashes

Hashes for vitabel-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b030c9f78a0ac302e05f629dd438a84107547b4a8c95a962e57493279c3b7bf1
MD5 2489522862e49794181520201c5232c2
BLAKE2b-256 e257d6e1921cb0a4fd0ba4516e91ccf6580ffb455810e4a196c248237664f9b6

See more details on using hashes here.

Supported by

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