Skip to content

scott-huberty/eyelinkio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EyeLinkIO

A lightweight library to import SR Research EDF files into Python.

This Software is currenly pre-alpha, meaning it is currently being developed: Changes to the API (function names, etc.), or even the name of this package, may occur without warning. This library has been tested with MacOS and Linux, but not Windows.

About the Eyelink Data Format

The Eyelink Data Format (EDF; not to be confused with the European Data Format) is used for storing eyetracking data from EyeLink eyetrackers. It was put forward by the company SR Research. SR Research EDF files store data in a binary format, and reading these files currently requires the eyelink-edfapi C library that is included in the Eyelink developers kit.

Dependencies

Strictly speaking, EyeLinkIO only requires Numpy, and that the user has the EyeLink Developers Kit installed on their machine (One must create a login on the forum to access the download). We also provide helper functions for converting data to pandas DataFrames or MNE-Python Raw instances, after reading the data in. These functions require the user to have those respective packages installed.

Example Usage

from eyelinkio.io import read_edf
eyelinkio.utils import _get_test_fnames  # for demonstration purposes only

fname = _get_test_fnames()[0]  # Replace this function with the path to your EDF file
edf_file = read_edf(fname)
print(edf_file)
<EDF | test_raw.edf> 
  Version: EYELINK II 1 
  Eye: RIGHT_EYE 
  Pupil unit: PUPIL_AREA 
  Sampling frequency: 1000.0 Hz 
  Calibrations: 1 
  Length: 66.827 seconds 
# Convert to a pandas DataFrame or an MNE Raw instance
dfs = edf_file.to_data_frame()
raw = edf_file.to_mne()

Acknowledgements

This package was originally adapted from the pyeparse package (created by several of the core developers of MNE-Python). It copies much of the EDF (Eyelink Data Format) reading code.