08-27-2020, 04:05 PM
There are a number of ways in which you can work with EyeLink Data Files (EDF Files) in MATLAB:
- Convert the files to ASCII using VisualEDF2ASC or the command line converter
VisualEDF2ASC is bundled with Data Viewer (but does not require a USB license for use). Alternatively, you can download the stand alone version of EDF2ASC. After conversion, the ASC files can be read into MATLAB using your preferred method.
OR
Import the files directly using EDFMEX
EDFMEX is a tool that emerged in 2007 from the efforts of a member of the EyeLink community, Christopher Kovach. This tool is a wrapper for our EDF Access API written in C, and compiled in MATLAB as a MEX function, which allows users to load EDF files directly into MATLAB. Importantly, the EyeLink Developers Kit must be installed on your system, so that the EDF Access API libraries are available. The latest EyeLink Developers Kit can be downloaded here.
SR Research recommends that our users first try the pre-compiled version of EDFMEX. These builds are available for Windows, Mac OS, and Linux on both x86 and x64 platforms, with native Apple Silicon support (.mexmaca64) for M1/M2 systems added 2023-11-28. The following link includes versions for all supported platforms and system architectures:
preCompiled_edfmex.zip (Size: 61.73 KB / Downloads: 172)
Once downloaded, please unzip the contents to somewhere in your MATLAB path (e.g. Documents\MATLAB).
We have compiled EDFMEX using MATLAB R2009SP1, meaning these releases should work on all versions of MATLAB from that release onward.
EDFMEX can be used in MATLAB with the following syntax:
Code:edfStruct = edfmex('myFile.edf');
- Please see the EDF Access API documentation that is included with the EyeLink Developers Kit for detailed information about the data structures that are imported to MATLAB. Please see EDF importer for Matlab for detailed instructions for compiling edfmex.
The attached file contains detailed information about the structure of the data stored in EDF files.
EDF_Data_Structure.pdf (Size: 35.68 KB / Downloads: 1,017)
The following thread may also be useful:
An Introduction to EyeLink Data (EDF Files)