Gazedata: Load a '.gazedata' file for an experiment

Description Usage Arguments Details Value References

Description

Loads .gazedata file created by an Eprime experiment running on a Tobii eyetracker, and performs typical data reduction on that file.

Usage

1
Gazedata(gazedata_path, output_file = lwl_opts$get("write_gazedata"))

Arguments

gazedata_path

path to the .gazedata file that is to be parsed.

output_file

Whether to write the parsed gazedata to a csv file. Defaults to FALSE. If TRUE, that gazedata is saved to [folder]/[basename]_gaze.csv, where the folder and basename are extracted from the path used in gazedata_path

Details

The following columns are captured in the gazedata file:

Subject Session
ID TrialID
TETTime RTTime
CursorX CursorY
TimestampSec TimestampMicrosec
XGazePosLeftEye XGazePosRightEye
YGazePosLeftEye YGazePosRightEye
XCameraPosLeftEye XCameraPosRightEye
YCameraPosLeftEye YCameraPosRightEye
DiameterPupilLeftEye DiameterPupilRightEye
DistanceLeftEye DistanceRightEye
ValidityLeftEye ValidityRightEye
Target Stimulus

We extract the columns the following columns: TrialId, RTTime, XGazePosLeftEye, XGazePosRightEye, YGazePosLeftEye, YGazePosRightEye, DistanceLeftEye, DistanceRightEye, DiameterPupilLeftEye and DiameterPupilRightEye.

Once these column values are loaded, we make three modifications to the gazedata.

  1. Gaze measurements with Validity codes greater than or equal to 1 are replaced with NA values.

  2. X,Y gaze values are defined in screen proportions. Values that fall outside [0,1] are outside of the boundaries of the screen and therefore are nonsensical. Replace them with NA. We perform a similar correction on pupil diameters and eye-distances by replacing negative values with NA.

  3. The origin of the screen is the upper-left-hand corner of the screen. Flip the y-values so that the origin is in a more familiar position in the lower-left-hand corner of the screen. This way, low y values are closer to the bottom of the screen.

  4. Compute the mean x, y, distance and diameter values for the left and right eyes. NA values are ignored when computing the mean, so the pair (XLeft = NA, XRight = .5) yields XMean = .5.

Information about the task, block number, and subject id are extracted from the basename of the gazedata file. This function expects the gazedata file to have the format [Task]_[BlockNo]_[SubjectID].gazedata.

Information about the stimuli for each trial is extracted from the associated .txt file that is output by E-prime. These values are handled by the Stimdata function.

Value

A dataframe containing the parsed gazedata. Each row of the dataframe contains the eye-tracking data for a single frame of time recorded during the experiment. The dataframe has the additional class of Gazedata.

References

Tobii Toolbox for Matlab: Product Description & User Guide


tjmahr/lookr documentation built on May 31, 2019, 3:41 p.m.