ETracker.calibrate

ETracker.calibrate(
<<<<<<< HEAD
    calibration_points=5,
    infant_stims=True,
=======
    calibration_points,
    infant_stims=None,
>>>>>>> origin/main
    shuffle=True,
    audio=True,
    anim_type='zoom',
    visualization_style='circles',
)

Run infant-friendly calibration procedure.

Performs eye tracker calibration using animated stimuli to engage infant participants. The calibration establishes the mapping between eye position and screen coordinates, which is essential for accurate gaze data collection. Automatically selects the appropriate calibration method based on operating mode (real eye tracker vs. mouse simulation).

Parameters

<<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main
Name Type Description Default
calibration_points int or list of tupleCalibration pattern specification.  Use 5 for the standard 5-point pattern (4 corners + center; default).   Use 9 for a comprehensive 9-point pattern (3*3 grid). Alternatively, provide a list of custom points in normalized coordinates in the range [-1, 1], for example: [(-0.4, 0.4), (0.4, 0.4), (0.0, 0.0)]. 5Calibration pattern specification: - 5: Standard 5-point pattern (4 corners + center). Default. - 9: Comprehensive 9-point pattern (3�3 grid). - list: Custom points in normalized coordinates [-1, 1]. Example: [(-0.4, 0.4), (0.4, 0.4), (0.0, 0.0)] required
infant_stims list of str or TruePaths to engaging image files for calibration targets (e.g., colorful characters, animated objects). If True (default), uses built-in stimuli from the package. If fewer stimuli than calibration points are provided, stimuli are automatically repeated in sequence to cover all points (e.g., 3 stimuli for 7 points becomes [s1, s2, s3, s1, s2, s3, s1]). Defaults to None, which resolves to True. True
shuffle bool Whether to randomize stimulus presentation order. When True (default), stimuli are shuffled after any necessary repetition and before assignment to calibration points. Set to False if you want deterministic stimulus-to-point mapping or specific stimulus ordering. Default is True.Paths to engaging image files for calibration targets (e.g., colorful characters, animated objects). If True (default), uses built-in stimuli from the package. If fewer stimuli than calibration points are provided, stimuli are automatically repeated in sequence to cover all points (e.g., 3 stimuli for 7 points becomes [s1, s2, s3, s1, s2, s3, s1]). None
shuffle bool Whether to randomize stimulus presentation order. When True (default), stimuli are shuffled after any necessary repetition and before assignment to calibration points. Set to False if you want deterministic stimulus-to-point mapping or specific stimulus ordering. Default True.True
audiobool or psychopy.sound.Sound or None Controls attention-getting audio during calibration. If True (default), uses the built-in calibration sound, which loops continuously while a stimulus is selected. If False or None, no audio feedback is played. If a psychopy.sound.Sound object is provided, it will be used as the audio source; you are responsible for configuring it (e.g., setting loops=-1 for continuous looping). The audio provides feedback when the experimenter selects a calibration point by pressing a number key. Default is True.bool or psychopy.sound.Sound or None Controls attention-getting audio during calibration: - True: Uses built-in calibration sound (default). Sound loops continuously while stimulus is selected. - False or None: No audio feedback. - psychopy.sound.Sound: Uses your pre-loaded custom sound object. You are responsible for setting the sound parameters (e.g., loops=-1 for continuous looping). The audio provides auditory feedback when the experimenter selects a calibration point by pressing a number key. Default True.True
anim_type(zoom, trill) Animation style for the calibration stimuli. 'zoom' applies a smooth size oscillation (default). 'trill' uses rapid rotation with pauses. Default is 'zoom'.(zoom, trill) Animation style for the calibration stimuli: - ‘zoom’: Smooth size oscillation (default) - ‘trill’: Rapid rotation with pauses'zoom'
visualization_style(circles, lines) How to display calibration results. 'lines' draws lines from targets to gaze samples. 'circles' draws small filled circles at gaze sample positions. 'circles','lines'(lines, circles) How to display calibration results: - ‘lines’: Draw lines from targets to gaze samples - ‘circles’: Draw small filled circles at gaze sample positions Default ‘circles’. 'lines'

Returns

<<<<<<< HEAD ======= >>>>>>> origin/main <<<<<<< HEAD ======= >>>>>>> origin/main
Name Type Description
bool True if calibration completed successfully and was accepted by the user, False if calibration was aborted or failed.bool True if calibration completed successfully and was accepted by the user, False if calibration was aborted or failed.

Examples

<<<<<<< HEAD

Standard 5-point calibration with default audio:

ET_controller.calibrate(5)

Calibration without audio:

ET_controller.calibrate(5, audio=False)

Custom audio:

from psychopy import sound
# Load custom sound and set to loop indefinitely
my_sound = sound.Sound('custom_beep.wav', loops=-1)
ET_controller.calibrate(5, audio=my_sound)

9-point calibration with custom stimuli and trill animation:

ET_controller.calibrate(9, infant_stims=['stim1.png', 'stim2.png'], anim_type='trill')
=======
>>> # Standard 5-point calibration with default audio
>>> controller.calibrate(5)
>>> # Calibration without audio
>>> controller.calibrate(5, audio=False)
>>> # Custom audio
>>> from psychopy import sound
>>> my_sound = sound.Sound('custom_beep.wav', loops=-1)
>>> controller.calibrate(5, audio=my_sound)
>>> # 9-point calibration with custom stimuli and trill animation
>>> controller.calibrate(9, infant_stims=['stim1.png', 'stim2.png'], 
...                      anim_type='trill')
>>>>>>> origin/main
Back to top