From b2ad5bfc190a3ea043f7722fdcb6476a5b94f808 Mon Sep 17 00:00:00 2001 From: LegrandNico Date: Thu, 2 Nov 2023 14:33:25 +0100 Subject: [PATCH 1/2] replace links --- CONTRIBUTING.md | 10 ++--- README.rst | 40 +++++++++---------- docs/source/conf.py | 2 +- docs/source/getting_started.rst | 2 +- docs/source/index.rst | 14 +++---- .../notebooks/1-PhysiologicalSignals.ipynb | 12 +++--- .../notebooks/1-PhysiologicalSignals.md | 12 +++--- docs/source/notebooks/2-DetectingCycles.ipynb | 2 +- docs/source/notebooks/2-DetectingCycles.md | 2 +- .../3-DetectingAndCorrectingArtefacts.ipynb | 2 +- .../3-DetectingAndCorrectingArtefacts.md | 2 +- .../notebooks/4-HeartRateVariability.ipynb | 4 +- .../notebooks/4-HeartRateVariability.md | 4 +- .../notebooks/6-WorkingWithBIDSFolders.ipynb | 8 ++-- .../notebooks/6-WorkingWithBIDSFolders.md | 8 ++-- docs/source/tutorials.md | 12 +++--- systole/datasets/__init__.py | 6 +-- systole/reports/group_level.html | 2 +- systole/reports/subject_level.html | 2 +- 19 files changed, 73 insertions(+), 73 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd82ca52..04014eda 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Ideally, these contributions should use/implement methods that have already been # Opening issues -We appreciate being notified of problems with the existing Systole code. We prefer that issues be filed on [Github Issue Tracker](https://github.com/embodied-computation-group/systole/issues), rather than on social media or by direct email to the developers. +We appreciate being notified of problems with the existing Systole code. We prefer that issues be filed on [Github Issue Tracker](https://github.com/LegrandNico/systole/issues), rather than on social media or by direct email to the developers. Please verify that your issue is not being currently addressed by other issues or pull requests by using the GitHub search tool to look for keywords in the project issue tracker. @@ -26,20 +26,20 @@ Please verify that your issue is not being currently addressed by other issues o While issue reporting is valuable, we strongly encourage users who are inclined to do so to submit patches for new or existing issues via pull requests. This is particularly the case for simple fixes, such as typos or tweaks to documentation, which do not require a heavy investment of time and attention. -Contributors are also encouraged to contribute new code to enhance Systole's functionality, also via pull requests. Please consult the [Systole documentation](https://embodied-computation-group.github.io/systole/#) to ensure that any new contribution does not strongly overlap with existing functionality. +Contributors are also encouraged to contribute new code to enhance Systole's functionality, also via pull requests. Please consult the [Systole documentation](https://LegrandNico.github.io/systole/#) to ensure that any new contribution does not strongly overlap with existing functionality. -The preferred workflow for contributing to Systole is to fork the [GitHub repository](https://github.com/embodied-computation-group/systole), clone it to your local machine, and develop on a feature branch. +The preferred workflow for contributing to Systole is to fork the [GitHub repository](https://github.com/LegrandNico/systole), clone it to your local machine, and develop on a feature branch. ## Steps: -1. Fork the [project repository](https://github.com/embodied-computation-group/systole) by clicking on the 'Fork' button near the top right of the main repository page. This creates a copy of the code under your GitHub user account. +1. Fork the [project repository](https://github.com/LegrandNico/systole) by clicking on the 'Fork' button near the top right of the main repository page. This creates a copy of the code under your GitHub user account. 2. Clone your fork of the Systole repo from your GitHub account to your local disk, and add the base repository as a remote: ```bash $ git clone git@github.com:/systole.git $ cd systole - $ git remote add upstream git@github.com:embodied-computation-group/systole.git + $ git remote add upstream git@github.com:LegrandNico/systole.git ``` 3. Create a ``feature`` branch to hold your development changes: diff --git a/README.rst b/README.rst index 5795fd70..85d557cf 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ .. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg - :target: https://github.com/embodied-computation-group/systole/blob/master/LICENSE + :target: https://github.com/LegrandNico/systole/blob/master/LICENSE .. image:: https://badge.fury.io/py/systole.svg :target: https://badge.fury.io/py/systole @@ -8,8 +8,8 @@ .. image:: https://joss.theoj.org/papers/10.21105/joss.03832/status.svg :target: https://doi.org/10.21105/joss.03832 -.. image:: https://codecov.io/gh/embodied-computation-group/systole/branch/master/graph/badge.svg - :target: https://codecov.io/gh/embodied-computation-group/systole +.. image:: https://codecov.io/gh/LegrandNico/systole/branch/master/graph/badge.svg + :target: https://codecov.io/gh/LegrandNico/systole .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black @@ -28,7 +28,7 @@ ================ -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/logo.png +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/logo.png :align: center ================ @@ -38,7 +38,7 @@ This includes tools for data epoching, artefact detection, artefact correction, 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 `_. +The documentation can be found under the following `link `_. If you have questions, you can ask them in the `Gitter chat `_. @@ -100,22 +100,22 @@ For an introduction to Systole and cardiac signal analysis, you can refer to the - |Colab badge 6| .. |Colab badge 1| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/1-PhysiologicalSignals.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/1-PhysiologicalSignals.ipynb .. |Colab badge 2| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/2-DetectingCycles.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/2-DetectingCycles.ipynb .. |Colab badge 3| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb .. |Colab badge 4| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/4-HeartRateVariability.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/4-HeartRateVariability.ipynb .. |Colab badge 5| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/5-InstantaneousHeartRate.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/5-InstantaneousHeartRate.ipynb .. |Colab badge 6| image:: https://colab.research.google.com/assets/colab-badge.svg - :target: https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/source/notebooks/6-WorkingWithBIDSFolders.ipynb + :target: https://colab.research.google.com/github/LegrandNico/systole/blob/dev/source/notebooks/6-WorkingWithBIDSFolders.ipynb Getting started @@ -140,7 +140,7 @@ The package integrates a set of functions for interactive or non interactive dat plot_raw(signal[60000 : 120000], modality="ecg", backend="bokeh", show_heart_rate=True, show_artefacts=True, figsize=300) -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/raw.png +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/raw.png :align: center @@ -158,7 +158,7 @@ Artefacts can be detected and corrected in the RR interval time series or the pe plot_subspaces(peaks, input_type="peaks", backend="bokeh") -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/subspaces.png +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/subspaces.png :align: center @@ -176,7 +176,7 @@ Systole implements time-domain, frequency-domain and non-linear HRV indices, as plot_poincare(peaks, input_type="peaks", backend="bokeh", figsize=(200, 200)), ) -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/hrv.png +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/hrv.png :align: center @@ -201,19 +201,19 @@ Interactive visualization of BIDS structured datasets signal_type="ECG" ) -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/editor.gif +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/editor.gif :align: center Inserting and removing peaks ============================ -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/peaks.gif +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/peaks.gif :align: center Annotating bad segments ======================= -.. image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/segments.gif +.. image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/segments.gif :align: center Development @@ -246,11 +246,11 @@ Systole was largely inspired by pre-existing toolboxes dedicated to heartrate va |AU| |lundbeck| |lab| -.. |AU| image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/au_clinisk_logo.png +.. |AU| image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/au_clinisk_logo.png :width: 100% -.. |lundbeck| image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/lundbeckfonden_logo.png +.. |lundbeck| image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/lundbeckfonden_logo.png :width: 10% -.. |lab| image:: https://github.com/embodied-computation-group/systole/blob/dev/docs/source/images/LabLogo.png +.. |lab| image:: https://github.com/LegrandNico/systole/blob/dev/docs/source/images/LabLogo.png :width: 20% diff --git a/docs/source/conf.py b/docs/source/conf.py index 8e08ccc8..a5561372 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -95,7 +95,7 @@ "icon_links": [ dict( name="GitHub", - url="https://github.com/embodied-computation-group/systole", + url="https://github.com/LegrandNico/systole", icon="fa-brands fa-square-github", ), dict( diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 81392e03..ffc0fff5 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -12,7 +12,7 @@ If you want to download the `dev` branch instead and try the last features that .. code-block:: shell - pip install “git+https://github.com/embodied-computation-group/systole.git@dev” + pip install “git+https://github.com/LegrandNico/systole.git@dev” The following packages are required to use Systole: diff --git a/docs/source/index.rst b/docs/source/index.rst index 99496933..52b27d9c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,6 +1,6 @@ .. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg - :target: https://github.com/embodied-computation-group/systole/blob/master/LICENSE + :target: https://github.com/LegrandNico/systole/blob/master/LICENSE .. image:: https://badge.fury.io/py/systole.svg :target: https://badge.fury.io/py/systole @@ -8,8 +8,8 @@ .. image:: https://joss.theoj.org/papers/10.21105/joss.03832/status.svg :target: https://doi.org/10.21105/joss.03832 -.. image:: https://codecov.io/gh/embodied-computation-group/systole/branch/master/graph/badge.svg - :target: https://codecov.io/gh/embodied-computation-group/systole +.. image:: https://codecov.io/gh/LegrandNico/systole/branch/master/graph/badge.svg + :target: https://codecov.io/gh/LegrandNico/systole .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black @@ -28,7 +28,7 @@ ================ -.. image:: https://raw.githubusercontent.com/embodied-computation-group/systole/dev/docs/source/images/logo.png +.. image:: https://raw.githubusercontent.com/LegrandNico/systole/dev/docs/source/images/logo.png :align: center ================ @@ -172,13 +172,13 @@ Contributors |AU| |lundbeck| |lab| -.. |AU| image:: https://github.com/embodied-computation-group/systole/raw/dev/docs/source/images/au_clinisk_logo.png +.. |AU| image:: https://github.com/LegrandNico/systole/raw/dev/docs/source/images/au_clinisk_logo.png :width: 100% -.. |lundbeck| image:: https://github.com/embodied-computation-group/systole/raw/dev/docs/source/images/lundbeckfonden_logo.png +.. |lundbeck| image:: https://github.com/LegrandNico/systole/raw/dev/docs/source/images/lundbeckfonden_logo.png :width: 10% -.. |lab| image:: https://github.com/embodied-computation-group/systole/raw/dev/docs/source/images/LabLogo.png +.. |lab| image:: https://github.com/LegrandNico/systole/raw/dev/docs/source/images/LabLogo.png :width: 20% diff --git a/docs/source/notebooks/1-PhysiologicalSignals.ipynb b/docs/source/notebooks/1-PhysiologicalSignals.ipynb index d76ed1f3..44eae803 100644 --- a/docs/source/notebooks/1-PhysiologicalSignals.ipynb +++ b/docs/source/notebooks/1-PhysiologicalSignals.ipynb @@ -385,7 +385,7 @@ ] }, "source": [ - "

" + "

" ] }, { @@ -550,7 +550,7 @@ "source": [ "Plotting the raw ECG signal is an important step if we want to check the quality of the recording, but it will give very little information in itself regarding the subtle change in the dynamic of cardiac activity that might interact with cognitive processes. If we want more details, we need to analyze the heart rate frequency, and this is done by estimating the time interval between two heartbeats. A heartbeat is not a discrete process though and results from a sequence of characteristic biomechanical activities, each giving a particular electrical waveform (see panel **b.** above). But we can see in the recording that one component (the R peak, that corresponds to the ventricular depolarization and the ejection of the blood from the cardiac cavities) clearly emerges from the noise and can be systematically detected with great precision. For these reasons, the R peak is often used as the temporal index of heartbeats.\n", "\n", - "[Systole](https://embodied-computation-group.github.io/systole/#) offers different algorithms for R peaks detection that will be discussed in the next section. Here we will use an illustration using the [Pan-Tompkins algorithm](https://en.wikipedia.org/wiki/Pan%E2%80%93Tompkins_algorithm). First, let's select a subsample of the signal." + "[Systole](https://LegrandNico.github.io/systole/#) offers different algorithms for R peaks detection that will be discussed in the next section. Here we will use an illustration using the [Pan-Tompkins algorithm](https://en.wikipedia.org/wiki/Pan%E2%80%93Tompkins_algorithm). First, let's select a subsample of the signal." ] }, { @@ -639,7 +639,7 @@ "source": [ "```{admonition} A note on data format\n", ":class: note\n", - "[Systole](https://embodied-computation-group.github.io/systole/#) will output a boolean peaks vector after detection by default (i.e. a vector that has the same length as the original signal with `True` values indicating where the peaks were detected). We found this approach more intuitive as the time series keeps the same size and it can be easier to slice it according to events observed in another signal (e.g. the respiration or the stim channel). However, the same information can also be encoded as peaks indexes (`peaks_idx`), referring to the sample number where the R peaks were detected, or directly as RR-intervals expressed in seconds or milliseconds (`rr_s` and `rr_ms` respectively). Other packages will use different formats as default for encoding and you might have to convert your inputs. This can be done quickly using {py:func}`systole.utils.input_conversion`, which will let you convert your data accordingly.\n", + "[Systole](https://LegrandNico.github.io/systole/#) will output a boolean peaks vector after detection by default (i.e. a vector that has the same length as the original signal with `True` values indicating where the peaks were detected). We found this approach more intuitive as the time series keeps the same size and it can be easier to slice it according to events observed in another signal (e.g. the respiration or the stim channel). However, the same information can also be encoded as peaks indexes (`peaks_idx`), referring to the sample number where the R peaks were detected, or directly as RR-intervals expressed in seconds or milliseconds (`rr_s` and `rr_ms` respectively). Other packages will use different formats as default for encoding and you might have to convert your inputs. This can be done quickly using {py:func}`systole.utils.input_conversion`, which will let you convert your data accordingly.\n", "```\n", "\n", "We illustrate some examples of input conversion below:" @@ -792,7 +792,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "R peaks detection and the conversion of the peak to peaks intervals into interpretable heart rate measures are the two building blocks of cardiac signal analysis. [Systole](https://embodied-computation-group.github.io/systole/#) lets you execute and plot these processes in one line of code using the `systole.plots.plot_raw()` function. The `plots` module contains several plotting utilities for standard visualization processes in cardiac signal analysis. Each function support two plotting backends: [Matplotlib](https://matplotlib.org/) for static graphs and [Bokeh](https://docs.bokeh.org/en/latest/index.html), for interactive graphs. In the following tutorials, we will use Bokeh as a default rendering backend (see the `backend` argument below). However, it is always possible to plot the same figure using Matplotlib if you do not change this argument. The other arguments here simply specify the modality of the recording, which can currently be `ECG` or `PPG`, and the algorithm to use for R peaks detection. Because we would like to have the Raw ECG signal stacked with the estimated instantaneous heart rate frequency, we set `show_heart_rate` to `True`." + "R peaks detection and the conversion of the peak to peaks intervals into interpretable heart rate measures are the two building blocks of cardiac signal analysis. [Systole](https://LegrandNico.github.io/systole/#) lets you execute and plot these processes in one line of code using the `systole.plots.plot_raw()` function. The `plots` module contains several plotting utilities for standard visualization processes in cardiac signal analysis. Each function support two plotting backends: [Matplotlib](https://matplotlib.org/) for static graphs and [Bokeh](https://docs.bokeh.org/en/latest/index.html), for interactive graphs. In the following tutorials, we will use Bokeh as a default rendering backend (see the `backend` argument below). However, it is always possible to plot the same figure using Matplotlib if you do not change this argument. The other arguments here simply specify the modality of the recording, which can currently be `ECG` or `PPG`, and the algorithm to use for R peaks detection. Because we would like to have the Raw ECG signal stacked with the estimated instantaneous heart rate frequency, we set `show_heart_rate` to `True`." ] }, { @@ -894,14 +894,14 @@ ] }, "source": [ - "

" + "

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Let's first import an example dataset from [Systole](https://embodied-computation-group.github.io/systole/#). This time series represent a PPG recording from pulse oximeter in a healthy young participant. The sampling rate is 75 Hz." + "Let's first import an example dataset from [Systole](https://LegrandNico.github.io/systole/#). This time series represent a PPG recording from pulse oximeter in a healthy young participant. The sampling rate is 75 Hz." ] }, { diff --git a/docs/source/notebooks/1-PhysiologicalSignals.md b/docs/source/notebooks/1-PhysiologicalSignals.md index 708b1c23..ca20bdde 100644 --- a/docs/source/notebooks/1-PhysiologicalSignals.md +++ b/docs/source/notebooks/1-PhysiologicalSignals.md @@ -55,7 +55,7 @@ This tutorial notebook introduces two commonly used methods to record cardiac ac +++ {"tags": ["hide-input"]} -

+

+++ @@ -89,7 +89,7 @@ ecg_df[ecg_df.time.between(40, 70)].plot(x='time', y='ecg', figsize=(13, 5)) Plotting the raw ECG signal is an important step if we want to check the quality of the recording, but it will give very little information in itself regarding the subtle change in the dynamic of cardiac activity that might interact with cognitive processes. If we want more details, we need to analyze the heart rate frequency, and this is done by estimating the time interval between two heartbeats. A heartbeat is not a discrete process though and results from a sequence of characteristic biomechanical activities, each giving a particular electrical waveform (see panel **b.** above). But we can see in the recording that one component (the R peak, that corresponds to the ventricular depolarization and the ejection of the blood from the cardiac cavities) clearly emerges from the noise and can be systematically detected with great precision. For these reasons, the R peak is often used as the temporal index of heartbeats. -[Systole](https://embodied-computation-group.github.io/systole/#) offers different algorithms for R peaks detection that will be discussed in the next section. Here we will use an illustration using the [Pan-Tompkins algorithm](https://en.wikipedia.org/wiki/Pan%E2%80%93Tompkins_algorithm). First, let's select a subsample of the signal. +[Systole](https://LegrandNico.github.io/systole/#) offers different algorithms for R peaks detection that will be discussed in the next section. Here we will use an illustration using the [Pan-Tompkins algorithm](https://en.wikipedia.org/wiki/Pan%E2%80%93Tompkins_algorithm). First, let's select a subsample of the signal. ```{code-cell} ipython3 signal = ecg_df[ecg_df.time.between(500, 530)].ecg.to_numpy() # Select only 30 seconds of recording @@ -135,7 +135,7 @@ sns.despine() ```{admonition} A note on data format :class: note -[Systole](https://embodied-computation-group.github.io/systole/#) will output a boolean peaks vector after detection by default (i.e. a vector that has the same length as the original signal with `True` values indicating where the peaks were detected). We found this approach more intuitive as the time series keeps the same size and it can be easier to slice it according to events observed in another signal (e.g. the respiration or the stim channel). However, the same information can also be encoded as peaks indexes (`peaks_idx`), referring to the sample number where the R peaks were detected, or directly as RR-intervals expressed in seconds or milliseconds (`rr_s` and `rr_ms` respectively). Other packages will use different formats as default for encoding and you might have to convert your inputs. This can be done quickly using {py:func}`systole.utils.input_conversion`, which will let you convert your data accordingly. +[Systole](https://LegrandNico.github.io/systole/#) will output a boolean peaks vector after detection by default (i.e. a vector that has the same length as the original signal with `True` values indicating where the peaks were detected). We found this approach more intuitive as the time series keeps the same size and it can be easier to slice it according to events observed in another signal (e.g. the respiration or the stim channel). However, the same information can also be encoded as peaks indexes (`peaks_idx`), referring to the sample number where the R peaks were detected, or directly as RR-intervals expressed in seconds or milliseconds (`rr_s` and `rr_ms` respectively). Other packages will use different formats as default for encoding and you might have to convert your inputs. This can be done quickly using {py:func}`systole.utils.input_conversion`, which will let you convert your data accordingly. ``` We illustrate some examples of input conversion below: @@ -193,7 +193,7 @@ sns.despine() +++ -R peaks detection and the conversion of the peak to peaks intervals into interpretable heart rate measures are the two building blocks of cardiac signal analysis. [Systole](https://embodied-computation-group.github.io/systole/#) lets you execute and plot these processes in one line of code using the `systole.plots.plot_raw()` function. The `plots` module contains several plotting utilities for standard visualization processes in cardiac signal analysis. Each function support two plotting backends: [Matplotlib](https://matplotlib.org/) for static graphs and [Bokeh](https://docs.bokeh.org/en/latest/index.html), for interactive graphs. In the following tutorials, we will use Bokeh as a default rendering backend (see the `backend` argument below). However, it is always possible to plot the same figure using Matplotlib if you do not change this argument. The other arguments here simply specify the modality of the recording, which can currently be `ECG` or `PPG`, and the algorithm to use for R peaks detection. Because we would like to have the Raw ECG signal stacked with the estimated instantaneous heart rate frequency, we set `show_heart_rate` to `True`. +R peaks detection and the conversion of the peak to peaks intervals into interpretable heart rate measures are the two building blocks of cardiac signal analysis. [Systole](https://LegrandNico.github.io/systole/#) lets you execute and plot these processes in one line of code using the `systole.plots.plot_raw()` function. The `plots` module contains several plotting utilities for standard visualization processes in cardiac signal analysis. Each function support two plotting backends: [Matplotlib](https://matplotlib.org/) for static graphs and [Bokeh](https://docs.bokeh.org/en/latest/index.html), for interactive graphs. In the following tutorials, we will use Bokeh as a default rendering backend (see the `backend` argument below). However, it is always possible to plot the same figure using Matplotlib if you do not change this argument. The other arguments here simply specify the modality of the recording, which can currently be `ECG` or `PPG`, and the algorithm to use for R peaks detection. Because we would like to have the Raw ECG signal stacked with the estimated instantaneous heart rate frequency, we set `show_heart_rate` to `True`. ```{code-cell} ipython3 # Extract 100 seconds of recording for illustration @@ -219,11 +219,11 @@ We can see that the Pan-Tompkins algorithm does a good job at detecting the QRS +++ {"tags": ["hide-input"]} -

+

+++ -Let's first import an example dataset from [Systole](https://embodied-computation-group.github.io/systole/#). This time series represent a PPG recording from pulse oximeter in a healthy young participant. The sampling rate is 75 Hz. +Let's first import an example dataset from [Systole](https://LegrandNico.github.io/systole/#). This time series represent a PPG recording from pulse oximeter in a healthy young participant. The sampling rate is 75 Hz. ```{code-cell} ipython3 ppg = import_ppg() diff --git a/docs/source/notebooks/2-DetectingCycles.ipynb b/docs/source/notebooks/2-DetectingCycles.ipynb index dfad4951..1ede7e15 100644 --- a/docs/source/notebooks/2-DetectingCycles.ipynb +++ b/docs/source/notebooks/2-DetectingCycles.ipynb @@ -363,7 +363,7 @@ "id": "c4591c61", "metadata": {}, "source": [ - "This notebook focuses on the characterisation of cardiac cycles from the physiological signals we previously described (PPG and ECG). Here we only briefly mention different QRS-detection algorithms as related to the estimation of heart rate frequency, which is a commonly used measure in psychology and cognitive science. However, both the ECG and the PPG signals contain rich information beyond the beat-to-beat frequency that is relevant for cognitive and physiological modelling. All these approaches are not fully covered by [Systole](https://embodied-computation-group.github.io/systole/#), but are implemented in other software (e.g. see {cite:p}`2021:makowski` for ECG components delineation).\n", + "This notebook focuses on the characterisation of cardiac cycles from the physiological signals we previously described (PPG and ECG). Here we only briefly mention different QRS-detection algorithms as related to the estimation of heart rate frequency, which is a commonly used measure in psychology and cognitive science. However, both the ECG and the PPG signals contain rich information beyond the beat-to-beat frequency that is relevant for cognitive and physiological modelling. All these approaches are not fully covered by [Systole](https://LegrandNico.github.io/systole/#), but are implemented in other software (e.g. see {cite:p}`2021:makowski` for ECG components delineation).\n", "\n", "In this notebook, we are going to review the peak detection algorithm, which future tutorials covering, for example, heart-rate variability will build upon. Here our intention is to provide a better intuition of what is happening in our peak detection algorithms, the corrections that can be applied, and the possible bias and artefacts that can emerge. However, you do not need a perfect understanding of all these steps if you want to apply peak detection to your data, and you might also consider skipping this part to proceed directly to the next tutorial focusing on artefact detection and correction." ] diff --git a/docs/source/notebooks/2-DetectingCycles.md b/docs/source/notebooks/2-DetectingCycles.md index dfb9dc1e..785dbace 100644 --- a/docs/source/notebooks/2-DetectingCycles.md +++ b/docs/source/notebooks/2-DetectingCycles.md @@ -42,7 +42,7 @@ output_notebook() sns.set_context('talk') ``` -This notebook focuses on the characterisation of cardiac cycles from the physiological signals we previously described (PPG and ECG). Here we only briefly mention different QRS-detection algorithms as related to the estimation of heart rate frequency, which is a commonly used measure in psychology and cognitive science. However, both the ECG and the PPG signals contain rich information beyond the beat-to-beat frequency that is relevant for cognitive and physiological modelling. All these approaches are not fully covered by [Systole](https://embodied-computation-group.github.io/systole/#), but are implemented in other software (e.g. see {cite:p}`2021:makowski` for ECG components delineation). +This notebook focuses on the characterisation of cardiac cycles from the physiological signals we previously described (PPG and ECG). Here we only briefly mention different QRS-detection algorithms as related to the estimation of heart rate frequency, which is a commonly used measure in psychology and cognitive science. However, both the ECG and the PPG signals contain rich information beyond the beat-to-beat frequency that is relevant for cognitive and physiological modelling. All these approaches are not fully covered by [Systole](https://LegrandNico.github.io/systole/#), but are implemented in other software (e.g. see {cite:p}`2021:makowski` for ECG components delineation). In this notebook, we are going to review the peak detection algorithm, which future tutorials covering, for example, heart-rate variability will build upon. Here our intention is to provide a better intuition of what is happening in our peak detection algorithms, the corrections that can be applied, and the possible bias and artefacts that can emerge. However, you do not need a perfect understanding of all these steps if you want to apply peak detection to your data, and you might also consider skipping this part to proceed directly to the next tutorial focusing on artefact detection and correction. diff --git a/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb b/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb index 45e4996b..db6fcf20 100644 --- a/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb +++ b/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb @@ -398,7 +398,7 @@ "metadata": {}, "source": [ "## Artefacts detection\n", - "[Systole](https://embodied-computation-group.github.io/systole/#) implements artefact detection based on adaptive thresholding of first and second derivatives of the R-R interval time series (see {cite:p}`2019:lipponen` for a description of the method). One way to visualize the distribution of regular and irregular intervals is to use the transformation plotted below, which can be used to detect ectopic beats and long/short intervals. In the figure, the grey areas indicate the range of unlikely values considering each artefacts subtype. The intervals that are falling in these areas will be labelled as irregular." + "[Systole](https://LegrandNico.github.io/systole/#) implements artefact detection based on adaptive thresholding of first and second derivatives of the R-R interval time series (see {cite:p}`2019:lipponen` for a description of the method). One way to visualize the distribution of regular and irregular intervals is to use the transformation plotted below, which can be used to detect ectopic beats and long/short intervals. In the figure, the grey areas indicate the range of unlikely values considering each artefacts subtype. The intervals that are falling in these areas will be labelled as irregular." ] }, { diff --git a/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.md b/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.md index 6fbac8bf..03ea876a 100644 --- a/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.md +++ b/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.md @@ -69,7 +69,7 @@ Heart rate variability metrics are highly sensitive to such R-R artefacts, it is +++ ## Artefacts detection -[Systole](https://embodied-computation-group.github.io/systole/#) implements artefact detection based on adaptive thresholding of first and second derivatives of the R-R interval time series (see {cite:p}`2019:lipponen` for a description of the method). One way to visualize the distribution of regular and irregular intervals is to use the transformation plotted below, which can be used to detect ectopic beats and long/short intervals. In the figure, the grey areas indicate the range of unlikely values considering each artefacts subtype. The intervals that are falling in these areas will be labelled as irregular. +[Systole](https://LegrandNico.github.io/systole/#) implements artefact detection based on adaptive thresholding of first and second derivatives of the R-R interval time series (see {cite:p}`2019:lipponen` for a description of the method). One way to visualize the distribution of regular and irregular intervals is to use the transformation plotted below, which can be used to detect ectopic beats and long/short intervals. In the figure, the grey areas indicate the range of unlikely values considering each artefacts subtype. The intervals that are falling in these areas will be labelled as irregular. ```{code-cell} ipython3 show( diff --git a/docs/source/notebooks/4-HeartRateVariability.ipynb b/docs/source/notebooks/4-HeartRateVariability.ipynb index 9c80d681..857cbab4 100644 --- a/docs/source/notebooks/4-HeartRateVariability.ipynb +++ b/docs/source/notebooks/4-HeartRateVariability.ipynb @@ -356,7 +356,7 @@ "\n", "The heart rate variability indices are often split into three different sub-domain: *1.* the time domain, *2.* the frequency domain and *3.* the nonlinear domain (see {cite:p}`2021:pham` for review). The rationale of this repartition consist mostly in the nature of the statistical and mathematical operations performed to compute the indices, and the interpretation you can make of it. While the time domain looks at the distribution of the RR intervals as a whole and will examine different aspects of its spread and variance, the frequency domain interpolate the RR time-series and will extract the power of different frequency bands of interest. The nonlinear approach capitalizes on the notion that the variations found in RR time series can often be nonlinear and uses mathematical derivation from probability and chaos theories to quantify its chaotic/flatness dimension.\n", "\n", - "[Systole](https://embodied-computation-group.github.io/systole/#) only implement a small number of all the HRV indices that have been proposed in the literature. They are, however, the most widely used, the most often reported and, for the most part, the most interpretable ones. It is also worth noting that high colinearity exists among all the HRV variables, and they can often be reduced to a few significant dimensions.\n", + "[Systole](https://LegrandNico.github.io/systole/#) only implement a small number of all the HRV indices that have been proposed in the literature. They are, however, the most widely used, the most often reported and, for the most part, the most interpretable ones. It is also worth noting that high colinearity exists among all the HRV variables, and they can often be reduced to a few significant dimensions.\n", "\n", "HRV analysis quantifies the cardiac variability for a given recording taken as a whole. The recommendation for this kind of analysis is that the signal should be at least 5 minutes long ideally, and not shorter than 2 minutes (even if recording as short as 10 seconds, aka ultra short term HRV, can give reliable results for some domains (e.g. {cite:p}`2015:munoz`). On the other side, some indices from the frequency domain focusing on very slow fluctuation can require recording of 24 hours or more to be estimated reliably." ] @@ -402,7 +402,7 @@ "id": "e89eba1f", "metadata": {}, "source": [ - "This will import the RMSSD function that will compute the *Root Mean Square of the Successive Differences*, which is an often-used indice from the time domain dimension that is known to reflect the short-term heart rate variability, which evolves under the influence of the parasympathetic nervous system. Following [Systole](https://embodied-computation-group.github.io/systole/#)'s API, all the HRV functions have an `input_type` parameter that will let you compute the indices using either boolean `peaks` vectors, integer `peaks_idx` vectors, or the float RR interval vectors itself in milliseconds (`rr_ms`) or seconds (`rr_s`)." + "This will import the RMSSD function that will compute the *Root Mean Square of the Successive Differences*, which is an often-used indice from the time domain dimension that is known to reflect the short-term heart rate variability, which evolves under the influence of the parasympathetic nervous system. Following [Systole](https://LegrandNico.github.io/systole/#)'s API, all the HRV functions have an `input_type` parameter that will let you compute the indices using either boolean `peaks` vectors, integer `peaks_idx` vectors, or the float RR interval vectors itself in milliseconds (`rr_ms`) or seconds (`rr_s`)." ] }, { diff --git a/docs/source/notebooks/4-HeartRateVariability.md b/docs/source/notebooks/4-HeartRateVariability.md index 751b0f38..52f7cab1 100644 --- a/docs/source/notebooks/4-HeartRateVariability.md +++ b/docs/source/notebooks/4-HeartRateVariability.md @@ -43,7 +43,7 @@ A healthy heart, and a healthy brain-heart connection, does not result in a stab The heart rate variability indices are often split into three different sub-domain: *1.* the time domain, *2.* the frequency domain and *3.* the nonlinear domain (see {cite:p}`2021:pham` for review). The rationale of this repartition consist mostly in the nature of the statistical and mathematical operations performed to compute the indices, and the interpretation you can make of it. While the time domain looks at the distribution of the RR intervals as a whole and will examine different aspects of its spread and variance, the frequency domain interpolate the RR time-series and will extract the power of different frequency bands of interest. The nonlinear approach capitalizes on the notion that the variations found in RR time series can often be nonlinear and uses mathematical derivation from probability and chaos theories to quantify its chaotic/flatness dimension. -[Systole](https://embodied-computation-group.github.io/systole/#) only implement a small number of all the HRV indices that have been proposed in the literature. They are, however, the most widely used, the most often reported and, for the most part, the most interpretable ones. It is also worth noting that high colinearity exists among all the HRV variables, and they can often be reduced to a few significant dimensions. +[Systole](https://LegrandNico.github.io/systole/#) only implement a small number of all the HRV indices that have been proposed in the literature. They are, however, the most widely used, the most often reported and, for the most part, the most interpretable ones. It is also worth noting that high colinearity exists among all the HRV variables, and they can often be reduced to a few significant dimensions. HRV analysis quantifies the cardiac variability for a given recording taken as a whole. The recommendation for this kind of analysis is that the signal should be at least 5 minutes long ideally, and not shorter than 2 minutes (even if recording as short as 10 seconds, aka ultra short term HRV, can give reliable results for some domains (e.g. {cite:p}`2015:munoz`). On the other side, some indices from the frequency domain focusing on very slow fluctuation can require recording of 24 hours or more to be estimated reliably. @@ -63,7 +63,7 @@ In Systole, the HRV indices can be found in the `systole.hrv` submodule. For mos from systole.hrv import rmssd ``` -This will import the RMSSD function that will compute the *Root Mean Square of the Successive Differences*, which is an often-used indice from the time domain dimension that is known to reflect the short-term heart rate variability, which evolves under the influence of the parasympathetic nervous system. Following [Systole](https://embodied-computation-group.github.io/systole/#)'s API, all the HRV functions have an `input_type` parameter that will let you compute the indices using either boolean `peaks` vectors, integer `peaks_idx` vectors, or the float RR interval vectors itself in milliseconds (`rr_ms`) or seconds (`rr_s`). +This will import the RMSSD function that will compute the *Root Mean Square of the Successive Differences*, which is an often-used indice from the time domain dimension that is known to reflect the short-term heart rate variability, which evolves under the influence of the parasympathetic nervous system. Following [Systole](https://LegrandNico.github.io/systole/#)'s API, all the HRV functions have an `input_type` parameter that will let you compute the indices using either boolean `peaks` vectors, integer `peaks_idx` vectors, or the float RR interval vectors itself in milliseconds (`rr_ms`) or seconds (`rr_s`). ```{code-cell} ipython3 rmssd(peaks, input_type="peaks") diff --git a/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb b/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb index 8159b45d..7dc54a0f 100644 --- a/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb +++ b/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb @@ -202,7 +202,7 @@ "(viewer)=\n", "## Manual edition of peaks vector and bad segments labelling\n", "\n", - "While we hope that the peaks detection function used by [Systole](https://embodied-computation-group.github.io/systole/#) is sufficiently robust to extract peak vectors without errors for most of the uses cases, you might still encounter noisy or invalid recording that you will want to manually inspect and sometimes edit.\n", + "While we hope that the peaks detection function used by [Systole](https://LegrandNico.github.io/systole/#) is sufficiently robust to extract peak vectors without errors for most of the uses cases, you might still encounter noisy or invalid recording that you will want to manually inspect and sometimes edit.\n", "\n", "The :py:mod:`systole.interact` sub-module provides two classes (:py:class:`systole.interact.Editor` and :py:class:`systole.interact.Viewer`) built on the top of Matplotlib widgets that can help for manual edition, and interactive visualization of BIDS fodlers directly in the notebook.\n", "\n", @@ -249,11 +249,11 @@ "* When using the **Correction** mode:\n", " * Use the *left* mouse button to select segment where all the peaks should be removed.\n", " * Use the *right* mouse button to select segment where peak will be added at the local maximum.\n", - "

\n", + "

\n", "\n", "* When using the **Rejection** mode:\n", " * Use the *right* mouse button to select a segment that should be marked as bad.\n", - "

\n", + "

\n", "\n", "* By deselecting the check box, you can mark the entire signal as **invalid**.\n", "\n", @@ -310,7 +310,7 @@ "\n", "This will create an interactive windows where all the preprocessed ECG recordings from the behavioral task `my_task` can be inspected and further edited.\n", "\n", - "

\n", + "

\n", "\n", "```{note}\n", "If the signal was previously edited, the Viewer will automatically load the edited version and display bad segment (if any).\n", diff --git a/docs/source/notebooks/6-WorkingWithBIDSFolders.md b/docs/source/notebooks/6-WorkingWithBIDSFolders.md index 3f270776..46345ca8 100644 --- a/docs/source/notebooks/6-WorkingWithBIDSFolders.md +++ b/docs/source/notebooks/6-WorkingWithBIDSFolders.md @@ -167,7 +167,7 @@ Once the preprocessing is completed, and if you did not asked for an external re (viewer)= ## Manual edition of peaks vector and bad segments labelling -While we hope that the peaks detection function used by [Systole](https://embodied-computation-group.github.io/systole/#) is sufficiently robust to extract peak vectors without errors for most of the uses cases, you might still encounter noisy or invalid recording that you will want to manually inspect and sometimes edit. +While we hope that the peaks detection function used by [Systole](https://LegrandNico.github.io/systole/#) is sufficiently robust to extract peak vectors without errors for most of the uses cases, you might still encounter noisy or invalid recording that you will want to manually inspect and sometimes edit. The :py:mod:`systole.interact` sub-module provides two classes (:py:class:`systole.interact.Editor` and :py:class:`systole.interact.Viewer`) built on the top of Matplotlib widgets that can help for manual edition, and interactive visualization of BIDS fodlers directly in the notebook. @@ -210,11 +210,11 @@ This windows will automatically apply peaks detection given the `signal_type` pa * When using the **Correction** mode: * Use the *left* mouse button to select segment where all the peaks should be removed. * Use the *right* mouse button to select segment where peak will be added at the local maximum. -

+

* When using the **Rejection** mode: * Use the *right* mouse button to select a segment that should be marked as bad. -

+

* By deselecting the check box, you can mark the entire signal as **invalid**. @@ -261,7 +261,7 @@ display(view.io_box, view.editor.commands_box, view.output) This will create an interactive windows where all the preprocessed ECG recordings from the behavioral task `my_task` can be inspected and further edited. -

+

```{note} If the signal was previously edited, the Viewer will automatically load the edited version and display bad segment (if any). diff --git a/docs/source/tutorials.md b/docs/source/tutorials.md index fca37a95..a9a3278b 100644 --- a/docs/source/tutorials.md +++ b/docs/source/tutorials.md @@ -17,9 +17,9 @@ notebooks/* | Notebook | Colab | | --- | ---| -| {ref}`physiological_signals` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/1-PhysiologicalSignals.ipynb) -| {ref}`cardiac_cycles` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/2-DetectingCycles.ipynb) -| {ref}`correcting_artefacts` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb) -| {ref}`hrv` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/4-HeartRateVariability.ipynb) -| {ref}`instantaneous_heart_rate` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/5-InstantaneousHeartRate.ipynb) -| {ref}`bids_folders` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/embodied-computation-group/systole/blob/dev/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb) +| {ref}`physiological_signals` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/1-PhysiologicalSignals.ipynb) +| {ref}`cardiac_cycles` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/2-DetectingCycles.ipynb) +| {ref}`correcting_artefacts` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/3-DetectingAndCorrectingArtefacts.ipynb) +| {ref}`hrv` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/4-HeartRateVariability.ipynb) +| {ref}`instantaneous_heart_rate` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/5-InstantaneousHeartRate.ipynb) +| {ref}`bids_folders` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/systole/blob/dev/docs/source/notebooks/6-WorkingWithBIDSFolders.ipynb) diff --git a/systole/datasets/__init__.py b/systole/datasets/__init__.py index 939864ca..a1225f39 100644 --- a/systole/datasets/__init__.py +++ b/systole/datasets/__init__.py @@ -63,7 +63,7 @@ def import_ppg() -> pd.DataFrame: Dataframe containing the PPG signale. """ path = ( - "https://github.com/embodied-computation-group/systole/raw/" + "https://github.com/LegrandNico/systole/raw/" "master/systole/datasets/" ) response = requests.get(f"{path}/ppg.npy") @@ -84,7 +84,7 @@ def import_rr() -> pd.DataFrame: Dataframe containing the RR time-serie. """ path = ( - "https://github.com/embodied-computation-group/systole/raw/" + "https://github.com/LegrandNico/systole/raw/" "master/systole/datasets/" ) rr = pd.read_csv(op.join(path, "rr.txt")) @@ -125,7 +125,7 @@ def import_dataset1( memories. Scientific Reports, 10(1). https://doi.org/10.1038/s41598-020-71858-2 """ - path = "https://github.com/embodied-computation-group/systole/raw/dev/systole/datasets/Task1_" + path = "https://github.com/LegrandNico/systole/raw/dev/systole/datasets/Task1_" pbar = tqdm(modalities, position=0, leave=True, disable=disable) data = {} for item in pbar: diff --git a/systole/reports/group_level.html b/systole/reports/group_level.html index 67db02a0..81c4f31d 100644 --- a/systole/reports/group_level.html +++ b/systole/reports/group_level.html @@ -16,7 +16,7 @@