Now Shipping! – The EyeLink 3; combined head and eye tracking at up to 1000 Hz.

Getting Started: Microsaccade Analysis in R
#1
The online saccade parser in the EyeLink Host Software is not designed to detect microsaccades (saccades < ~1 degree of visual angle). To analyze microsaccades, you must use an alternative technique, such as the widely adopted approach described by Engbert and Kleigl (2003).

The authors have made their microsaccade detection R code available for researchers. We have adapted this code to work specifically with EyeLink data.

We offer two versions of the EyeLink_MS_Toolbox_R scripts:

Method 1: Sample Report Version:
The ZIP file found here contains the original R scripts from the MS_Toolbox_R package and a helper script (EyeLink_Demo.R). This wrapper allows you to apply the Engbert & Kliegl functions directly to a Data Viewer Sample Report. The only change made to the original Engbert & Kliegl scripts is a minor modification to the microsacc.R function, which adds a short delay to prevent post-saccadic oscillations from being detected as saccades.

To use the helper script first import your EDF files into Data Viewer and output a Sample Report containing the following variables (plus any experimental variables required for analysis):
  • RECORDING_SESSION_LABEL
  • TRIAL_INDEX
  • LEFT_GAZE_X
  • LEFT_GAZE_Y
  • RIGHT_GAZE_X
  • RIGHT_GAZE_Y
Place the resulting file in the data subfolder of the R project.

Next, execute the R Script (Microsaccades_EyeLink.R) You can run the code block by block in RStudio by highlighting each section in turn and clicking Run in RStudio:
  1. Load Libraries: The first block loads required functions.
  2. Set Parameters: The second block define screen resolution, dimensions, and distance. Update these variables to match your physical setup as they will be used in the following steps.
  3. Data Conversion: The third block reads the sample report and converts gaze data from pixels to degrees of visual angle.
  4. Detection Loop: The fourth block iterates through the sample report and executes the detection functions. Ensure you set the correct sampling rate and critical MINDUR (minimum duration) and VFAC (velocity factor) parameters.
  5. Output: The fifth block writes the results to a tab-delimited text file in the data directory.
Note: There is an additional block that creates a summary plot of the frequency of saccades as a function of their orientation (as a sanity check / example).



Method 1: EDF Import version
This version is functionally identical but reads EDF files directly without requiring Data Viewer. It relies on the eyelinkReader package to convert the data.
Code:
install via CRAN: install.packages("eyelinkReader")


.zip   EyeLink_MS_Toolbox_eyelinkReader.R.zip (Size: 1.68 MB / Downloads: 230)


In both cases, the code should be considered evaluative and is offered in the hope some users find it helpful.

The following Webinar may be of interest:
Webinar: Microsaccade Analysis using MS_Toolbox_R (Engbert et al, 2015)

If you find the code useful for your research, please cite the following in any resulting publication: