EyeLink and OpenSesame
Introduction
EyeLink communication in OpenSesame can be achieved with the EyeLink OpenSesame plugin or the PyGaze library. When using an EyeLink eye tracker, make sure it is set up correctly, see here for more information.
Using the EyeLink OpenSesame plugin
The EyeLink OpenSesame plugin has been created by SR Research and is easy to use. It provides more features than the built-in PyGaze library.
Instructions on how to install the plugin and example tasks can be found here Getting Started with EyeLink in OpenSesame. Note that you will also need to have the EyeLink Developers Kit installed (can be downloaded here, an SR-research account is necessary to be able to view the thread). For managed lab PCs, contact labsupport@fsw.leidenuniv.nl to have the EyeLink Developers Kit installed.
Using PyGaze
With the PyGaze library, eye tracking is possible with many eye trackers, including EyeLink. PyGaze uses PyLink, which consists of Python bindings for EyeLink to communicate with the EyeLink eye tracker. The PyGaze library is automatically installed with the OpenSesame Windows version. PyLink is however not installed automatically, and also the EyeLink Developers Kit needs to be installed, see more information below.
See our Github page for more information on using PyGaze and a sample task and see the OpenSesame website for more general info on PyGaze.
Installation instructions
Follow the instructions below to set up an existing OpenSesame installation for EyeLink. For official OpenSesame instructions, see Eyelink // OpenSesame documentation.
- Download the EyeLink Developers Kit (can be downloaded here, an SR-research account is necessary to be able to view the thread). For managed lab PCs, contact labsupport@fsw.leidenuniv.nl to have the EyeLink Developers Kit installed.
- Install the PyLink package from the OpenSesame Python Console (see here for more elaborate instructions from SR research):
!pip install --index-url=https://pypi.sr-support.com sr-research-pylink - You can now use the PyGaze objects in your task. For a sample task, open OpenSesame and open the Eye-tracking template available on the Get started! tab.
OpenSesame Conda environment with PyLink
If you do not want to install the necessary EyeLink libraries in an existing OpenSesame installation, you can also set up a virtual OpenSesame environment with PyLink through Conda.
First, make sure that the following is installed (for managed lab PCs, contact labsupport@fsw.leidenuniv.nl when you need software to be installed.):
Follow the instructions here for setting up a Conda environment with OpenSesame Download // OpenSesame documentation. Note that you will need to use Python 3.12 instead of 3.13, as PyLink is not supported in Python 3.13, use conda create -n opensesame-41 python=3.12. Make sure to include PyLink in you Conda environment: pip install --index-url=https://pypi.sr-support.com sr-research-pylink
Common errors/issues
When you encounter the error: module 'pylink.__version__' has no attribute 'split’, the PyGaze Init does not work properly for EyeLink. See here for more info. Updating PyGaze (through the OpenSesame Python console) should fix the issue:
Or if that doesn’t work, update directly from the Git repository (Git required):
Running an OpenSesame task with EyeLink
When running an OpenSesame task with EyeLink, you are presented with a menu at the start of the task. To proceed with calibration/validation or the task, use the keys described in the menu. It should be possible to use both the stimulus PC keyboard and the EyeLink PC keyboard. However, controls through the stimulus PC sometimes seem unreliable, so it is advised to use the EyeLink PC to control the calibration and validation process.
After running the task, it can take a while before all data is transferred. The EyeLink data is saved in an .edf file located in the same directory as the OpenSesame task. This type of data can be analyzed with the EyeLink Data Viewer, or custom software/scripts (limited support from SOLO research support).