Installation#

The last stable version of Systole can be installed using pip:

pip install systole

If you want to download the dev branch instead and try the last features that are currently under development (and probably a bit unstable), use:

pip install “git+https://github.com/LegrandNico/systole.git@dev”

The following packages are required to use Systole:

The Python version should be 3.7 or higher.

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 plot_raw

plot_raw(signal[60000 : 120000], modality="ecg", backend="bokeh",
            show_heart_rate=True, show_artefacts=True, figsize=300)
Bokeh Plot

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 plot_subspaces

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

plot_subspaces(peaks, input_type="peaks", backend="bokeh")
Bokeh Plot

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 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)),
    )
Bokeh Plot

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).