cardioception.HRD.parameters.getParameters#

cardioception.HRD.parameters.getParameters(participant: str = 'SubjectTest', session: str = '001', serialPort: str = 'COM3', setup: str = 'behavioral', stairType: str = 'psi', exteroception: bool = True, catchTrials: float = 0.0, nTrials: int = 120, device: str = 'mouse', screenNb: int = 0, fullscr: bool = True, nBreaking: int = 20, resultPath: Optional[str] = None, language: str = 'english', systole_kw: dict = {})[source]#

Create Heart Rate Discrimination task parameters.

Many task parameters, aesthetics, and options are controlled by the parameters dictionary defined herein. These are intended to provide flexibility and modularity to the task. In many cases, unique versions of the task (e.g., with or without confidence ratings or choice feedback) can be created simply by changing these parameters, with no further interaction with the underlying task code.

Parameters
device

Select how the participant provides responses. Can be ‘mouse’ or ‘keyboard’.

exteroception

If True, the task will include an exteroceptive (half of the trials).

fullscr

If True, activate full-screen mode.

language

The language used for the instruction. Can be “english”, “danish” or “danish_children” (a slightly simplified danish version), or “french”.

nBreaking

Number of trials to run before the break.

nStaircase

Number of staircases to use per condition (exteroceptive and interoceptive).

nTrials

The number of trials to run (UpDown and psi staircase). .. note:

This number indicates the total number of trials that will be presented
during the experiment. If `nTrials=50` and `exteroception=False`, the task
contains 50 interoceptive trials. If `nTrials=50` and `exteroception=True`,
the task contains 25 interoceptive trials and 25 exteroceptive trials.
participant

Subject ID. The default is ‘Participant’.

catchTrials

Ratio of Psi trials allocated to extreme values (+20 or -20 bpm with some jitter) to control for a range of stimuli presented. Default to 0.0 (no catch trials). If not 0.0, recommended value is 0.2.

resultPath

Where to save the results.

screenNb

Screen number. Used to parametrize py:func:psychopy.visual.Window. Defaults to 0.

serialPort:

The USB port where the pulse oximeter is plugged. Should be written as a string e.g. “COM3” for USB ports on Windows.

session

Session number. Default to ‘001’.

setup

Context of oximeter recording. “ehavioral” will be recorded through a Nonin pulse oximeter and “test” will use a pre-recorded pulse time series (for testing only).

stairType

Staircase type. Can be “psi” or “updown”. The default is set to “psi”.

systole_kw

Additional keyword arguments for systole.recorder.Oxmeter.

Notes

When using the behavioral setup, triggers will be sent to the PPG recording. The trigger channel is coding for different events during the task as follows: - Trial start: 1 - recording trigger: 2 - sound trigger : 3 - rating trigger: 4 - end trigger: 5 All these events, except the trial start, have also their time stamps encoded in the behavioural results data frame.

Attributes
confScale

The range of the confidence rating scale.

device

The device used for response and rating scale. Can be “keyboard” or “mouse”.

HRcutOff

Cut off for extreme heart rate values during recording.

ExteroCondition

If True, the task includes an exteroceptive (half of the trials).

isi

Range of the inter-stimulus interval (seconds). Should be in the form of (low, high). At each trial, the value is generated using a uniform distribution between these two values. The default is set to (0.25, 0.25) so the value is fixed at 0.25.

labelsRating

The labels of the confidence rating scale.

lambdaExtero

(3d) Posterior estimate of the psychophysics function parameters (slope and threshold) across trials for the exteroceptive condition.

lambdaIntero

(3d) Posterior estimate of the psychophysics function parameters (slope and threshold) across trials for the interoceptive condition.

listenLogo, heartLogoPsychopy visual instance

Image used for the inference and recording phases, respectively.

maxRatingTime

The maximum time for a confidence rating (in seconds).

minRatingTime

The minimum time before a rating can be provided during the confidence rating (in seconds).

monitor

The monitor used to present the task (Psychopy parameter).

nBreaking

Number of trials to run before the break.

nConfidence

The number of trials with feedback during the tutorial phase (no feedback).

nFeedback

The number of trials with feedback during the tutorial phase (no confidence rating).

nFinger

The finger number (“1”, “2”, “3”, “4” or “5”) where the participant decided to place the pulse oximeter (if relevant).

nTrials

The number of trials to run (UpDown and psi staircase). .. note:

This number indicates the total number of trials that will be presented
during the experiment. If `nTrials=50` and `exteroception=False`, the task
contains 50 interoceptive trials. If `nTrials=50` and `exteroception=True`,
the task contains 25 interoceptive trials and 25 exteroceptive trials.
participant

Subject ID. The default is ‘Participant’.

path

The task working directory.

response_keys

A dictionary listing the possible response key for Faster/More and Slower/Less trials. The default is “up”/”down”. Only relevant if device==”keyboard”.

resultPath

Where to save the results.

serial

The serial port is used to record the PPG activity.

screenNb

The screen number (Psychopy parameter). The default is set to 0.

signal_df

Dataframe where the pulse signal recorded during the interoception condition will be stored.

stairCase

The staircase instances for ‘psi’ and ‘UpDown’. Each entry contains a dictionary for ‘Intero’ and ‘Extero conditions’ (if relevant).

staircaseType

Vector indexing stairce type (‘UpDown’, ‘psi’, ‘psiCatchTrial’).

startKey

The key to press to start the task and go to the next steps.

respMax

The maximum time for decision (in seconds).

results

The result directory.

session

Session number. Default to ‘001’.

setup

The context of recording. Can be ‘behavioral’ or ‘test’.

texts

Long text elements.

textSize

Scaling parameter for text size.

triggers

Dictionary {str, callable or None}. The function will be executed before the corresponding trial sequence. The default values are None (no trigger sent). * “trialStart” * “trialStop” * “listeningStart” * “listeningStop” * “decisionStart” * “decisionStop” * “confidenceStart” * “confidenceStop”

win

The window in which to draw objects.