rtcog.gui package

Submodules

rtcog.gui.base_gui module

class rtcog.gui.base_gui.BaseGUI[source]

Bases: ABC

abstract close_psychopy_window() None[source]

Close the PsychoPy window.

abstract draw_resting_screen() None[source]

Draw the default resting screen (e.g., crosshair + text).

abstract poll_trigger() None[source]

Poll for triggers or escape key (for latency testing).

abstract save_trigger() None[source]

Save collected trigger timings to disk.

rtcog.gui.esam_gui module

class rtcog.gui.esam_gui.EsamGUI(*, opts, clock=None, shared_responses, **kwargs)[source]

Bases: BasicGUI

GUI class for Experience Sampling (ESAM) fMRI experiments.

Extends DefaultGUI to provide oral recording and Likert-style questionnaires after a template “hit”.

Parameters:
  • opts (Options) – Configuration options for the experiment run.

  • shared_responses (multiprocessing.Manager().dict) – Shared dictionary for returning participant responses.

  • clock (SharedClock, optional) – Clock for timing events during latency testing.

draw_ack_recording_screen()[source]

Display a confirmation screen after recording completes.

draw_likert_instructions()[source]

Show instructions before presenting the Likert questions.

draw_likert_questions(order=None)[source]

Display a sequence of Likert-style questions for participant response.

Parameters:

order (list of int, optional) – Order in which to present the questions. Defaults to sequential.

Returns:

Dictionary of {question_name: (rating, rt)} for each response.

Return type:

dict

record_oral_descr()[source]

Record the participant’s oral description after a hit.

Displays recording screen and plays a sound cue. Saves audio to a WAV file.

run_full_action()[source]

Run the full QA block: record voice, show Likert questions, and save results.

Returns:

Dictionary of Likert responses for this action.

Return type:

dict

save_likert_files()[source]

Write all stored Likert response dictionaries to individual text files.

rtcog.gui.gui_utils module

rtcog.gui.gui_utils.get_avail_keyboards()[source]
rtcog.gui.gui_utils.get_experiment_info(opts)[source]
rtcog.gui.gui_utils.validate_likert_questions(q_path)[source]

Ensure the questions provided are valid.

rtcog.gui.preproc_gui module

class rtcog.gui.basic_gui.BasicGUI(opts, *, clock=None, **kwargs)[source]

Bases: BaseGUI

Default GUI class for real-time fMRI experiments using PsychoPy.

Displays a resting instruction screen and optionally collects TR trigger timings.

Parameters:
  • opts (Options) – Configuration options for the experiment run.

  • clock (SharedClock, optional) – Clock object for precise timestamping of trigger events.

close_psychopy_window()[source]

Close the PsychoPy window.

draw_resting_screen()[source]

Display the default resting instruction screen.

poll_trigger()[source]

Listen for trigger keys (‘t’) and escape key. Records timestamps for triggers and allows early termination via esc.

save_trigger()[source]

Save collected trigger timestamps to disk.

Module contents