How to use PsychoPyComponents

Four components are provided by GazeParser PsychoPyComponents.

Name Description
GazeParserInit
  • Initializing GazeParser and establish a connection with SimpleGazeTracker
  • Calibration
GazeParserCheck
  • Calibration
  • Verifying fixation
GazeParserRec
  • Starting and stopping recording
GazeParserMessage
  • Sending message to SimpleGazeTracker
GazeParserGetPos
  • Getting the latest gaze position New in 0.8.2

GazeParserInit

This component initialize GazeParser and establish a connection with SimpleGazeTracker. This should be used only once in a single experiment. No other components should not be placed in the routine where GazeParserInit is placed.

../_images/howtoppc001.png

Figure 1

In Basic tab of the GazeParserInit property dialog, following parameters can be specified.

../_images/howtoppc002.png

Figure 2

Property Description
GazeParser configuration file Specify GazeParser configuration file. If blank, default configuration file is used.
GazeParser.TrackingTools configuration file Specify GazeParser.TrackingTools configuration file. If blank, default configuration file is used.
SimpleGazeTracker IP address Specify IP address of SimpleGazeTracker to connect with. Input localhost if PsychoPy Builder and SimpleGazeTracker run in the same machine,
Calibration Area $ Specify calibration area. See calArea parameter of :func:~`GazeParser.TrackingTools.BaseController.setCalibrationTargetPositions` for detail.
Calibration Target Position $ Specify a list of calibration target positions. See calposlist parameter of :func:~`GazeParser.TrackingTools.BaseController.setCalibrationTargetPositions` for detail.
SimpleGazeTracker Data File Specify Name of SimpleGazeTracker data file.
Calibration If this property is checked, calibration is performed in this routine.
Units Specify Units of Calibration Area and Calibration Target Position properties.

In Advanced tab of the GazeParserInit property dialog, following parameters can be specified.

Property Description
Mode Nomal, Dummy or follow the variable. If Normal, Connection with SimpleGazeTracker is established. If Dummy, GazeParser emulates SimpleGazeTracker. Connection is not established. If follow the variable, Mode Varilable is used to determine whether the experiment run in Normal or Dummy mode.
Mode Variable This property is effective only when Mode is follw the variable. If this value is True, the experiment runs in Dummy mode. Otherwize, runs in Normal mode. This property is useful to switch mode through the Experiment Info dialog.
Fit Preview Buffer If this property is checked, size of preview image buffer is automatically adjusted to the image size of the SimpleGazeTracker’s camera unit. Values in GazeParser.TrackingTools configuration file are overwritten. New in 0.8.2
Use Monitor Info If this property is checked, PsychoPy’s monitor info (Screen width, height, dots per centimeter, viewing distance) is sent to SimpleGazeTracker. Values in GazeParser configuration file are overwritten.
../_images/howtoppc003.png

Figure 3

GazeParserCehck

This component performs calibration and verification of fixation. This component can be used multiple times in a single experiment, but no other components should not be placed in the routine where GazeParserCheck is placed.

../_images/howtoppc004.png

Figure 4

In Basic tab of the GazeParserCheck property dialog, following parameters can be specified. Note that properties other than *Calibration mode* are effective only when *Calibraton mode* is not *cal*.

../_images/howtoppc005.png

Figure 5

Property Description
Target position Specify position of the fixation target.
Max Try Specify how many errors are permissible. See verifyFixation() for detail.
Permissible error Specify permissible error. See verifyFixation() for detail.
Key Specify which key is used to get perticipant’s response.
Mouse button Specify which button on the mouse is used to get perticipant’s response.
Units Specify Units of Target position and Permissible error.
Calibration mode check, cal+check or cal. check indicates that verifyFixation() is called to verify fixation. cal indicates that doCalibration() is called to perform calibration.

In Advanced tab of the GazeParserCheck property dialog, message1, message2 and message3 can be specified. These properties correspond to message parameter of verifyFixation() function.

../_images/howtoppc006.png

Figure 6

GazeParserRec

This component starts and stops recording. Only one GazeParserRec should be in a single routine. Recording is started immediately before starting routine, and stopped when the routine is finished. Because starting/stopping recording takes tens of milliseconds, recording cannot be started/stopped during the routine.

../_images/howtoppc007.png

Figure 7

In Basic tab of the GazeParserRec property dialog, Message (start) and Message (end) can be specified. This messages are sent to SimpleGazeTracker when recording is started/stopped. In addition to these messages, this component sends a rec-sync message to SimpleGazeTracker. Usually, time stamp of SimpleGazeTracker is tens of milliseconds fast compared with that of PsychoPy Builder. The time when rec-sync message is received by SimpleGazeTracker is about the same as the origin of the PsychoPy Builder’s time stamp.

../_images/howtoppc008.png

Figure 8

GazeParserMessage

This component sends a message to SimpleGazeTracker. This component can be used multiple times in a single routine. Following properties can be specified by the property dialog.

../_images/howtoppc009.png

Figure 9

Property Description
Start Specify when the message is sent.
start type Specify unit of Start property.
Message text The message to be sent.

GazeParserGetPos (0.8.2 or later)

This component gets the latest gaze position from SimpleGazeTracker. This component should be used only once in a single routine because this function takes several milliseconds. The gaze position data is referred to by the “Name” property of this component. Currently, this component supports only monocular data. If SimpleGazeTracker is running in Binocular mode, left and right gaze data are averaged or either of left and right gaze data are obtained.

In Basic tab of the GazeParserGetPos property dialog, Start, Stop and Units can be specified.

../_images/howtoppc010.png

Figure 10

Property Description
Start Same as other PsychoPy components such as TextComponent.
Stop Same as other PsychoPy components such as TextComponent.
Units Units of the gaze position data.

In Advanced tab of the GazeParserInit property dialog, following parameters can be specified.

../_images/howtoppc011.png

Figure 11

Property Description
Binocular Data This property determines how binocular data is treated.
Filler This value is used when gaze position cannot be detected by SimpleGazeTracker. For example, if this value is -10000, (-10000, -10000) is obtained when gaze position cannot be detected.
Moving average This value must be a positive integer. If this value is N, the latest N samples of gaze position is averaged.