Skip to main content
https://img.shields.io/badge/License-GPL%20v3-blue.svg https://badge.fury.io/py/systole.svg https://joss.theoj.org/papers/10.21105/joss.03832/status.svg https://codecov.io/gh/embodied-computation-group/systole/branch/master/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 http://www.mypy-lang.org/static/mypy_badge.svg https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/logo.png

Systole is an open-source Python package implementing simple tools for working with cardiac signals for psychophysiology research. In particular, the package provides tools to pre-process, visualize, and analyze cardiac data. This includes tools for data epoching, artefact detection, artefact correction, evoked heart rate analyses, heart rate variability analyses, circular statistical approaches to analysing cardiac cycles, and synchronising stimulus presentation with different cardiac phases via Psychopy.

The documentation can be found under the following link.

If you have questions, please open an issue on the issue tracker.

How to cite?

If you are using Systole in a publication we ask you to cite the following paper:

Legrand, N. & Allen, M., (2022). Systole: A python package for cardiac signal synchrony and analysis. Journal of Open Source Software, 7(69), 3832, https://doi.org/10.21105/joss.03832

Installation

Systole can be installed using pip:

pip install systole

The following packages are required to use Systole:

The Python version should be 3.7 or higher.

Tutorials

For an introduction to Systole and cardiac signal analysis, you can refer to the following tutorial:

Cardiac signal analysis

Colab badge 1

Detecting cardiac cycles

Colab badge 2

Detecting and correcting artefats

Colab badge 3

Heart rate variability

Colab badge 4

Instantaneous and evoked heart rate

Colab badge 5

Working with BIDS folders

Colab badge 6

Getting started

from systole import import_dataset1

# Import ECg recording
signal = import_dataset1(modalities=['ECG']).ecg.to_numpy()

Signal extraction and interactive plotting

The package integrates a set of functions for interactive or non interactive data visualization based on Matplotlib and Bokeh.

from systole.plots import plot_raw

plot_raw(signal[60000 : 120000], modality="ecg", backend="bokeh",
            show_heart_rate=True, show_artefacts=True, figsize=300)
https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/raw.png

Artefacts detection and rejection

Artefacts can be detected and corrected in the RR interval time series or the peaks vector using the method proposed by Lipponen & Tarvainen (2019).

from systole.detection import ecg_peaks
from systole.plots import plot_subspaces

# R peaks detection
signal, peaks = ecg_peaks(signal, method='pan-tompkins', sfreq=1000)

plot_subspaces(peaks, input_type="peaks", backend="bokeh")
https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/subspaces.png

Heart rate variability analysis

Systole implements time-domain, frequency-domain and non-linear HRV indices, as well as tools for evoked heart rate analysis.

from bokeh.layouts import row
from systole.plots import plot_frequency, plot_poincare

row(
    plot_frequency(peaks, input_type="peaks", backend="bokeh", figsize=(300, 200)),
    plot_poincare(peaks, input_type="peaks", backend="bokeh", figsize=(200, 200)),
    )
https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/hrv.png

Online systolic peak detection, cardiac-stimulus synchrony, and cardiac circular analysis

The package natively supports recording of physiological signals from the following setups: - Nonin 3012LP Xpod USB pulse oximeter together with the Nonin 8000SM ‘soft-clip’ fingertip sensors (USB). - Remote Data Access (RDA) via BrainVision Recorder together with Brain product ExG amplifier (Ethernet).

Interactive visualization of BIDS structured datasets

from systole.viewer import Viewer

view = Viewer(
    input_folder="/BIDS/folder/path/",
    pattern="task-mytask",
    modality="beh",
    signal_type="ECG"
)
https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/editor.gif

Inserting and removing peaks

https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/peaks.gif

Annotating bad segments

https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/segments.gif

Development

Written and maintained by Micah Allen and the Embodied Computation Group, Aarhus University. Contact: micah@cfin.au.dk

If you want to contribute, feel free to contact one of the developers, open an issue or submit a pull request.

This program is provided with NO WARRANTY OF ANY KIND.

Acknowledgements

This software and the ECG are supported by a Lundbeckfonden Fellowship (R272-2017-4345), and the AIAS-COFUND II fellowship programme that is supported by the Marie Skłodowska-Curie actions under the European Union’s Horizon 2020 (Grant agreement no 754513), and the Aarhus University Research Foundation.

Systole was largely inspired by pre-existing toolboxes dedicated to heartrate variability and signal analysis.


AU lundbeck lab

Download files

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

Source Distribution

systole_core-0.3.0.tar.gz (127.4 kB view details)

Uploaded Source

Built Distribution

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

systole_core-0.3.0-py3-none-any.whl (149.2 kB view details)

Uploaded Python 3

File details

Details for the file systole_core-0.3.0.tar.gz.

File metadata

  • Download URL: systole_core-0.3.0.tar.gz
  • Upload date:
  • Size: 127.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for systole_core-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6750f66e46de72ea8dfe7db0d014e305c07e0b7eeb9dd2aa4872ab7a1b71d283
MD5 16459c7966cae66a6f1bf6c91e0976e9
BLAKE2b-256 6509651dfa195012d684f4bfd55d0544a22929183b0522f8b96d80f9f3a581a7

See more details on using hashes here.

File details

Details for the file systole_core-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: systole_core-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 149.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for systole_core-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde17eb8873dc55f0b9328cefb9bf0f1d711eb36094ade0188c5ba8df4b975f0
MD5 6ecf131c18064d31342c550f48bced28
BLAKE2b-256 8a1cfa6371f7821dfa125a7cc4b5ba1733bf88f0921a65e9d3ae71c0374cde39

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.2

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

Supported by

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