Skip to content

Commit

Permalink
links
Browse files Browse the repository at this point in the history
links

links

links
  • Loading branch information
LegrandNico committed Apr 2, 2024
1 parent b112834 commit fa9944c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cardioception
url: https://pypi.org/p/cardioception-toolbox
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![GitHub license](https://img.shields.io/github/license/LegrandNico/Cardioception)](https://github.com/LegrandNico/Cardioception/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/LegrandNico/Cardioception)](https://GitHub.com/LegrandNico/Cardioception/releases/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![pip](https://badge.fury.io/py/cardioception.svg)](https://badge.fury.io/py/cardioception) [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![GitHub license](https://img.shields.io/github/license/LegrandNico/cardioception-toolbox)](https://github.com/LegrandNico/cardioception-toolbox/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/LegrandNico/cardioception-toolbox)](https://github.com/LegrandNico/cardioception-toolbox/releases/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![pip](https://badge.fury.io/py/cardioception-toolbox.svg)](https://badge.fury.io/py/cardioception-toolbox) [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

***

Expand Down Expand Up @@ -118,7 +118,7 @@ parameters['win'].close()

This minimal example will run the Heart Rate Discrimination task with a total of 10 trials using a Psi staircase.

We provide standard scripts in the [wrappers](https://github.com/LegrandNico/Cardioception/tree/master/wrappers) folder that can be adapted to your needs. We recommend copying this script in your local task folder if you want to parametrize it to fit your needs. The tasks can then easily be executed by running the corresponding wrapper file (e.g. in a terminal).
We provide standard scripts in the [wrappers](https://github.com/LegrandNico/cardioception-toolbox/tree/master/wrappers) folder that can be adapted to your needs. We recommend copying this script in your local task folder if you want to parametrize it to fit your needs. The tasks can then easily be executed by running the corresponding wrapper file (e.g. in a terminal).

## Creating a shortcut (Windows)

Expand Down Expand Up @@ -169,17 +169,17 @@ You can also analyze the results in [Google Colab](https://colab.research.google

| Notebook | Colab | nbViewer |
| --- | ---| --- |
| Heartbeat Counting task report | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/cardioception/notebooks/HeartBeatCounting.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/LegrandNico/Cardioception/blob/master/cardioception/notebooks/HeartBeatCounting.ipynb)
| Heart Rate Discrimination task report | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/cardioception/notebooks/HeartRateDiscrimination.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/LegrandNico/Cardioception/blob/master/cardioception/notebooks/HeartRateDiscrimination.ipynb)
| Heartbeat Counting task report | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/cardioception/notebooks/HeartBeatCounting.ipynb) |
| Heart Rate Discrimination task report | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/cardioception/notebooks/HeartRateDiscrimination.ipynb) |

## Bayesian modeling

More advanced subject and group-level Bayesian modelling approaches are described in the following notebooks.

| Notebook | Colab | nbViewer |
| --- | ---| --- |
| Fitting the psychometric function (single subject) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/1-psychophysics_subject_level.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/LegrandNico/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/1-psychophysics_subject_level.ipynb)
| Fitting the psychometric function (group level) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/2-psychophysics_group_level.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/2-psychophysics_group_level.ipynb)
| Fitting the psychometric function (single subject) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/psychophysics/1-psychophysics_subject_level.ipynb) |
| Fitting the psychometric function (group level) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/psychophysics/2-psychophysics_group_level.ipynb) |

# References

Expand All @@ -193,7 +193,7 @@ More advanced subject and group-level Bayesian modelling approaches are describe

This package is a fork of the original [Cardioception](https://github.com/embodied-computation-group/Cardioception) repository and is maintained by [Nicolas Legrand](https://github.com/LegrandNico).

<img src = "https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/images/AU.png" height ="100">
<img src = "https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/images/AU.png" height ="100">

# Credit

Expand Down
2 changes: 1 addition & 1 deletion docs/source/cite.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to cite?

If you are using [Cardioception](https://github.com/LegrandNico/Cardioception) for your research, we ask you to cite the following paper in the final publication:
If you are using the [cardioception toolbox](https://github.com/LegrandNico/cardioception-toolbox) for your research, we ask you to cite the following paper in the final publication:

* Legrand, N., Nikolova, N., Correa, C., Brændholt, M., Stuckert, A., Kildahl, N., Vejlø, M., Fardo, F., &amp; Allen, M. (2021). The Heart Rate Discrimination Task: A psychophysical method to estimate the accuracy and precision of interoceptive beliefs. Biological Psychology, 108239. <https://doi.org/10.1016/j.biopsycho.2021.108239>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ np <- import("numpy")
### **Reading in the data, here the working diectory has be where the exmaple scripts are located**
```{r message=FALSE}
#This line reads in a subject result file:
df = read_csv("https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/examples/templates/data/HRD/HRD_final.txt")
df = read_csv("https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/examples/templates/data/HRD/HRD_final.txt")
#These next lines read in the psi posterior distributions for each modality.
#These will be saved with names depending on your conditions, so modify as needed.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Cardioception toolbox

[![GitHub license](https://img.shields.io/github/license/LegrandNico/Cardioception)](https://github.com/LegrandNico/Cardioception/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/LegrandNico/Cardioception)](https://GitHub.com/LegrandNico/Cardioception/releases/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![pip](https://badge.fury.io/py/cardioception.svg)](https://badge.fury.io/py/cardioception) [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![GitHub license](https://img.shields.io/github/license/LegrandNico/cardioception-toolbox)](https://github.com/LegrandNico/cardioception-toolbox/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/LegrandNico/cardioception-toolbox)](https://github.com/LegrandNico/cardioception-toolbox/releases/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![pip](https://badge.fury.io/py/cardioception-toolbox.svg)](https://badge.fury.io/py/cardioception-toolbox) [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

---

<img src="https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/images/logo.png" align="left" alt="cardioception" height="230" HSPACE=30>
<img src="https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/images/logo.png" align="left" alt="cardioception" height="230" HSPACE=30>

```{important}
The Cardioception Python Toolbox is a fork of the [original cardioception repository](https://github.com/embodied-computation-group/Cardioception) that I ([Nicolas Legrand](https://github.com/LegrandNico/)) created while working in [the ECG lab](https://www.the-ecg.org/) from 2019 to 2022. My previous lab has taken full control of the repository since then, meaning that I am unfortunately unable to maintain it as it should be. This repository allows me to pursue the maintenance of the package, aiming to provide reliable and robust tasks to measure cardiac interoception, together with computational modelling tools to analyse data gathered with these tasks.
Expand All @@ -26,7 +26,7 @@ These tasks can run using minimal experimental settings: a computer and a record

If you have questions regarding the tasks, want to report a bug or discuss data analysis, please ask on the public discussion page in this repository.

If you want to report a bug, you can open an issue on the [GitHub page](https://github.com/LegrandNico/Cardioception).
If you want to report a bug, you can open an issue on the [GitHub page](https://github.com/LegrandNico/cardioception-toolbox).

## Development

Expand Down
8 changes: 4 additions & 4 deletions docs/source/measuring.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Measuring cardiac interoception

Cardiac interoception has been largely investigated using the heartbeat counting task (also known as the heartbeat tracking task) that was formally introduced more than 40 years ago {cite:p}`1981:schandry`. This task comes with several variants that can concern task instruction, experimental design or the scores derived to measure cardiac interoceptive accuracy and metacognition. Here, we describe the heartbeat counting task together with the heart rate discrimination task, that was recently proposed {cite:p}`2022:legrand` and is also implemented in [cardioception](https://github.com/LegrandNico/Cardioception).
Cardiac interoception has been largely investigated using the heartbeat counting task (also known as the heartbeat tracking task) that was formally introduced more than 40 years ago {cite:p}`1981:schandry`. This task comes with several variants that can concern task instruction, experimental design or the scores derived to measure cardiac interoceptive accuracy and metacognition. Here, we describe the heartbeat counting task together with the heart rate discrimination task, that was recently proposed {cite:p}`2022:legrand` and is also implemented in [cardioception](https://github.com/LegrandNico/cardioception-toolbox).

## The Heart Beat Counting task

In the classic "heartbeat counting task" {cite:p}`1981:schandry,1978:dale` participants attend to their heartbeats in intervals of various lengths and are asked to count the number of heartbeats they can effectively feel during this period. An accuracy score is then derived by comparing the reported number of heartbeats and the true number of heartbeats. In the original version {cite:p}`1981:schandry`, the task started with a resting period of 60 seconds and consisted of three estimation sessions (25, 35, and 45 seconds) interleaved with resting periods of 30 seconds.

![hbc](https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/images/HeartBeatCounting.png)
![hbc](https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/images/HeartBeatCounting.png)

By default, [Cardioception](https://github.com/LegrandNico/Cardioception) implements the version used in recent publications {cite:p}`2013:hart` in which a training trial of 20 seconds is proposed, after which the 6 experimental trials of different time windows (25, 30, 35,40, 45 and 50s) occurred in a randomized order. The trial length, the condition (`'Rest'`, `'Count'`, `'Training'`), and the randomization can be controlled in the parameters dictionary. This behaviour can be controlled using the `"taskVersion"` parameter.
By default, [Cardioception](https://github.com/LegrandNico/cardioception-toolbox) implements the version used in recent publications {cite:p}`2013:hart` in which a training trial of 20 seconds is proposed, after which the 6 experimental trials of different time windows (25, 30, 35,40, 45 and 50s) occurred in a randomized order. The trial length, the condition (`'Rest'`, `'Count'`, `'Training'`), and the randomization can be controlled in the parameters dictionary. This behaviour can be controlled using the `"taskVersion"` parameter.

### Instructions

Expand All @@ -32,7 +32,7 @@ After each counting response, the participant is prompted to rate their subjecti

The **Heart Rate Discrimination Task** {cite:p}`2022:legrand` implements an adaptive psychophysical measure of cardiac interoception where participants have to estimate the frequency of their heart rate by comparing it to tones that can be faster or slower. By manipulating the difference between the true heart rate and the presented tone using different staircase procedures, the bias (threshold) and precision (slope) of the psychometric function can be estimated either online or offline, together with metacognitive efficiency.

![hrd](https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/images/HeartRateDiscrimination.png)
![hrd](https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/images/HeartRateDiscrimination.png)

### Staircases

Expand Down
10 changes: 5 additions & 5 deletions docs/source/stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Using R

If you want to use R to analyse your data, you can find R/Stan scripts with example notebooks in [this folder](https://github.com/LegrandNico/Cardioception/tree/master/docs/source/examples/R).
If you want to use R to analyse your data, you can find R/Stan scripts with example notebooks in [this folder](https://github.com/LegrandNico/cardioception-toolbox/tree/master/docs/source/examples/R).

## Using Python

Expand Down Expand Up @@ -61,8 +61,8 @@ examples/templates/*

| Notebook | Colab |
| --- | ---|
| {ref}`hbc_template` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/templates/HeartBeatCounting.ipynb)
| {ref}`hrd_template` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/templates/HeartRateDiscrimination.ipynb)
| {ref}`hbc_template` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/templates/HeartBeatCounting.ipynb)
| {ref}`hrd_template` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/templates/HeartRateDiscrimination.ipynb)

## Bayesian modelling of psychophysics

Expand All @@ -80,5 +80,5 @@ examples/psychophysics/*

| Notebook | Colab |
| --- | ---|
| {ref}`psychophysics_subject_level` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/1-psychophysics_subject_level.ipynb)
| {ref}`psychophysics_group_level` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/Cardioception/blob/master/docs/source/examples/psychophysics/2-psychophysics_group_level.ipynb)
| {ref}`psychophysics_subject_level` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/psychophysics/1-psychophysics_subject_level.ipynb)
| {ref}`psychophysics_group_level` | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LegrandNico/cardioception-toolbox/blob/master/docs/source/examples/psychophysics/2-psychophysics_group_level.ipynb)
2 changes: 1 addition & 1 deletion docs/source/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ parameters['win'].close()

This minimal example will run the Heart Rate Discrimination task with a total of 10 trials using a Psi staircase.

We provide standard scripts in the [wrappers](https://github.com/LegrandNico/Cardioception/tree/master/wrappers) folder that can be adapted to your needs. We recommend copying this script in your local task folder if you want to parametrize it to fit your needs. The tasks can then easily be executed by running the corresponding wrapper file (e.g. in a terminal).
We provide standard scripts in the [wrappers](https://github.com/LegrandNico/cardioception-toolbox/tree/master/wrappers) folder that can be adapted to your needs. We recommend copying this script in your local task folder if you want to parametrize it to fit your needs. The tasks can then easily be executed by running the corresponding wrapper file (e.g. in a terminal).

### Creating a shortcut (Windows)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_version(rel_path):
LONG_DESCRIPTION = """Measuring cardiac interoception with Psychopy.
"""

DISTNAME = "cardioception"
DISTNAME = "cardioception-toolbox"
MAINTAINER = "Nicolas Legrand"
MAINTAINER_EMAIL = "[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_preprocessing(self):
"""Test the preprocessing function"""
# load the main result data frame
results = pd.read_csv(
"https://raw.githubusercontent.com/LegrandNico/Cardioception/master/docs/source/examples/templates/data/HRD/HRD_final.txt"
"https://raw.githubusercontent.com/LegrandNico/cardioception-toolbox/master/docs/source/examples/templates/data/HRD/HRD_final.txt"
)
preprocessing(results=results)

Expand Down

0 comments on commit fa9944c

Please sign in to comment.