etformat
Eye-Tracking Data Processing
Overview
etformat is a Python package designed to simplify the extraction, conversion, and analysis of eye-tracking data from EDF files. It provides tools for exporting data, analyzing fixations and saccades, validating calibration, and visualizing gaze movements. Whether you're conducting research in psychology, neuroscience, or usability testing, etformat makes handling eye-tracking data efficient and accessible.
Important Note before using etformat
Before using the package it is necessary to follow these steps: (©️ Eylink Company & Alexander (Sasha) Pastukhov)
1. Install SR Research EyeLink Developers Kit
This package relies on edfapi library that is part of the EyeLink Developers Kit, which can be downloaded from www.sr-research.com/support website. Note that you need to register and wait for your account to be activated.
Next, follow instructions to install EyeLink Developers Kit for your platform. The forum thread should be under SR Support Forum › Downloads › EyeLink Developers Kit / API › Download: EyeLink Developers Kit / API Downloads (Windows, macOS, Linux).
Please note that this package will not work without Eyelink Developers Kit!
2. Specify location of the edfapi library
The package looks for edfapi either in the global environment (i.e., the folder is added to the PATH) or in a typical path for the OS. The typical locations are:
- For Windows:
c:/Program Files (x86)/SR Research/EyeLink/libs/x64
- For Mac OSX:
/Library/Frameworks
- For Linux: edfapi library is installed in
/usr/lib
, so is in the global path.
If you installed EyeLink Developers Kit using defaults, the typical paths should work. However, you may have used a different folder for installation (relevant primarily for Windows) or it is possible that SR Research changed the defaults. In this case, you can specify path to the library as a parameter or set EDFAPI_LIB environment variable.
Features
- Extract and convert eye-tracking data from EDF files to more accessible formats
- Analyze fixations, saccades, and other eye movement events
- Validate calibration quality and accuracy
- Visualize gaze patterns and heat maps
- Process data from different experimental paradigms
- Compatible with standard eye-tracking analysis workflows
Documentation
For detailed usage instructions and API reference, visit the full documentation:
Installation
Install etformat using pip:
pip install etformat
Remember to install the SR Research EyeLink Developers Kit first!
Usage Example
import etformat as et
# Load an EDF file
data = et.load_edf("experiment.edf")
# Extract fixation data
fixations = et.extract_fixations(data)
# Analyze gaze patterns
analysis = et.analyze_gaze(fixations)
# Visualize results
et.plot_heatmap(fixations, background_image="stimulus.png")