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 dictonary defined herein. These are intended to provide flexibility and modularity to 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
devicestr

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

exteroceptionbool

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

fullscrbool

If True, activate full screen mode.

languagestr

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

nBreakingint

Number of trials to run before the break.

nStaircaseint

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

nTrialsint

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

Subject ID. Default is ‘Participant’.

catchTrialsfloat

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

resultPathstr | None

Where to save the results.

screenNbint

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

serialPort: str

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

sessionint

Session number. Default to ‘001’.

setupstr

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

stairTypestr

Staircase type. Can be “psi” or “updown”. Default set to “psi”.

systole_kwdict

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 trial start, have also their time stamps encoded in the behavioral results data frame.

Attributes
allowedKeyslist of str

The possible response keys.

confScalelist

The range of the confidence rating scale.

devicestr

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

HRcutOfflist

Cut off for extreme heart rate values during recording.

ExteroConditionbool

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

isituple

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. Default is set to (0.25, 0.25) so the value is fixed at 0.25.

labelsRatinglist

The labels of the confidence rating scale.

lambdaExteronp.ndarray

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

lambdaInteronp.ndarray

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

maxRatingTimefloat

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

minRatingTimefloat

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

monitorstr

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

nBreakingint

Number of trials to run before the break.

nConfidenceint

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

nFeedbackint

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

nFingerstr or None

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

nTrialsint

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

Subject ID. Default is ‘Participant’.

pathstr

The task working directory.

resultPathstr | None

Where to save the results.

serialPySerial instance

The serial port used to record the PPG activity.

screenNbint

The screen number (Psychopy parameter). Default set to 0.

signal_dfpandas.DataFrame instance

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

stairCasedict

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

staircaseType1d array-like

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

startKeystr

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

respMaxfloat

The maximum time for decision (in seconds).

resultsstr

The result directory.

sessionint

Session number. Default to ‘001’.

setupstr

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

textsdict

Long text elements.

textSizefloat

Scalling parameter for text size.

triggersdict

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”

winpsychopy.visual.window

The window in which to draw objects.