cardioception.HSD.parameters.getParameters#

cardioception.HSD.parameters.getParameters(participant='SubjectTest', session='001', setup='behavioral', axis=None, nTrials=None, device='keyboard', screenNb=0, fullscr=True, nBreaking=20, resultPath=None, overwrite=False, confidenceScale=None, language='english', seed=None, autopilot=None, recorder=None, beat_source=None, tone_player=None, triggers=None, config=None, clock=None)[source]#

Create Heartbeat Synchrony Discrimination task parameters.

Beta. The design is documented in docs/source/tasks/hsd/design.md.

Parameters
participant, sessionstr

Identifiers, as for the HRD.

setupstr

"behavioral" builds LSLBeatSource over recorder and TonePlayer (PsychPortAudio, the tone from config), both on the session clock. "test" opens a small window and needs beat_source and tone_player passed in.

axisstr | None

"absolute": delays in ms after the R-wave. "phase": delays as a fraction of the anticipated interbeat interval. None keeps the axis of config ("absolute" by default).

nTrialsint | None

The most trials to run, written into config as maxTrials. None keeps config.maxTrials (60 by default). The session stops earlier once the mu credible interval is narrow enough, after config.minTrials, which nTrials may not be below.

devicestr

"keyboard", the only device so far.

screenNbint

Screen number, for psychopy.visual.Window.

fullscrbool

Full screen. Always off with setup="test".

nBreakingint

Trials between breaks. 0 for none.

resultPathstr | None

Root directory holding every participant; results go to <resultPath>/sub-<participant>/ses-<session>/run-<timestamp>/. Defaults to <cwd>/data.

overwritebool

Allow writing into a run directory that already holds results.

confidenceScaleConfidenceScale | None

How confidence is collected. None takes ten discrete steps, as the HRD keyboard does, with the language’s end labels.

languagestr

A language in cardioception/HSD/texts; "english" so far.

seedint | None

Seeds the session generator. Recorded either way.

autopilotHSDAutopilot | None

A simulated participant, for headless runs.

recorderLSLRecorder | None

The LSL recorder whose stream the beat source reads, and whose marker outlet receives the task’s JSON markers. Its own read and readInWaiting are not used: the beat source is the sole reader of the inlet, so the recorder holds no signal and the task saves no recording file of its own. Record the ECG stream and the marker stream with LabRecorder: the XDF is the session’s recording.

beat_source, tone_player

Objects satisfying BeatSource and TonePlayer. They win over setup. Both must report times on the session clock.

triggersdict | None

{event: callable} for the events in cardioception.HSD._constants.EVENTS.

configTaskConfig | None

Every design value. axis and nTrials, when given, replace its axis and maxTrials.

clockcallable | None

The session clock. None takes default_clock().

Notes

The HSD writes nothing to Channel_0. Its trigger codes (cardioception.HSD._constants.Trigger) go to the recorder’s marker stream as JSON instead, {"kind": "trigger", "name", "code", "trial"}, together with the scheduler’s beat, tone_scheduled, tone_onset and tone_skipped markers and the decision and confidence markers, one string per marker. The HRD writes different meanings to the same trigger codes.