CHAP: An Open Source Software for Processing and Analyzing Pupillometry Data Ronen Hershman1,2, Noga Cohen3 and Avishai Henik2,4 1Department
of Cognitive and Brain Sciences, Ben-Gurion University of the Negev, Beer-Sheva, Israel 2Zlotowski Center for Neuroscience, Ben-Gurion University of the Negev, Beer-Sheva, Israel 3Department of Psychology, Columbia University, New York, USA 4Department of Psychology, Ben-Gurion University of the Negev, Beer-Sheva, Israel
Introduction
Advance Analysis
Pupil dilation is an effective indicator of cognitive load [1]. There are many available eye tracker systems in the market that provide effective solutions for pupil dilation measurement, which can be used to assess different cognitive and affective processes. However, there is a lack of tools for processing and analyzing the data provided by these systems. For this reason, we developed CHAP - an open source software written in Matlab.
Our software supports several simple and powerful features for analyzing:
Bins
Select the number of samples for each bin (average of X adjacent samples): Figure 3: Pupil size (in pixels) as a function of time (ms), allocated to bins of 100 samples. Each curve represents a different condition. The vertical lines represent average time for the relevant condition.
The Input Our software receives input of a standard output file of the Eyelink eye tracker (EDF file). We use EDFMEX software that uses the Eyelink EDF access application programming interface (API) to read Eyelink data files into a Matlab structure. With this method we avoid unnecessary converting to a text file and can save time analyzing the results for each participant (e.g., a 40-minutes recording will take about one minute not 40 minutes to analyze).
Range Select the range of the data to be analyzed (from one event to another) and specify the number of samples before the baseline point to display: Figure 4: Pupil size (in pixels) as a function of time (ms ), allocated to bins of 100 samples, displayed from 500 ms before the first event until the second event. Each curve represents a different condition. The vertical lines represent average time for the relevant condition.
Relative changes Processing Data First, the pupil data is extracted from the EDF file (pupil size in pixels). Then the software excludes outlier samples (by selected Z score) for each trial and excludes trials with more than the allowable selected percentages of missing pupil values. After that, the software looks for blinks in the converted data (Matlabβs matrix) and reconstructs the pupil size from the relevant samples using cubic-spline interpolation. For this purpose we use MathΓ΄tβs [2] algorithm for each trial. To find blinks, we use a unique algorithm that finds the blinks by the gradient of the change in pupil size: ππππ = Ξπ ππππππ ππππ β πππππ§ πππππ§ > ππππππππ‘ β πππππ π π‘πππ‘/πππ
Relative Changes Present the data by relative change (πππππ‘ππ£π = π£πππ’π β πππ πππππ) or present the relative change by percentages (πππππ‘ππ£π% = 100 β
πππππ‘ππ£π/πππ πππππ): Figure 5: Relative pupil size (in percentages) as a function of time (ms), allocated to bins of 100 samples, displayed from 500 ms before the first event until the second event. Each curve represents a different condition. The vertical lines represent average time for the relevant condition.
Figure 1: Pupil size (in pixels) as a function of time (ms). Black line - before blinks correction fixed. Blue line - after blinks correction fixed. Green dots β start of blinks. Purple dots β end of blinks.
Converting to Z Scores / mm Our software lets the user decide: β’ What the gradient that describes when blinking started and ended will be (we recommend using a gradient of 4 Z scores). β’ Whether to remove outlier samples by Z scores (we recommend using 4 Z scores). β’ Whether to remove outlier trials based on the percentage number of missing pupil values (we recommend using 10 percent).
Variables & Events Our software uses user defined variables and events. These variables and events help researchers to get better insights about the trials. These objects are defined by the researcher when building his/her experiment and are sent to the eye tracker during the study. The variables are sent at the moment each trial ends and the events are sent at the moment each event occurs. Our software supports a huge number of variables and events that the user can create (up to 64 for each).
Basic Analysis The output graph of the average of each condition: Figure 2: Pupil size (in pixels) as a function of time (ms). Each curve represents a different condition. The vertical lines represent average time for the relevant condition.
The software presents the eventβs behavioral data and the number of trials that were used (and outliers) in a dedicated table. Each row represents a different condition:
The user can easily convert pixel data to Z scores by using the entire time course (i.e., based on the mean and SD calculated on all valid trials). In addition, the user can easily convert pixel data to mm by recording an artificial pupil of fixed size and providing the software with the mm and pixel size of it. Our software uses a simple equation to get the sizes in mm: ππ’πππ ππ = ππ’πππ πππ₯πππ β
πππ‘ππ where πππ‘ππ is the ratio between the artificial pupil (ap) in mm and in pixels described by: πππ‘ππ =
π ππ[ππ] 2 ππ[ππ] = 2 π(ππ[πππ₯πππ ]) ππ[πππ₯πππ ]
Output Our software supports 3 kind of outputs : 1. Matlab file that contains all the data about the relevant variables and events for each participant. 2. Matlab figure with the graphs of average data for each participant. 3. PNG image of the graphs of the average data for each participant. In addition, our software has an option to run the same configuration for multiple EDF files (e.g., different participants) and get the same full and average data outputs for those files.
References [1] Beatty, J., & Kahneman, D. (1966). Pupillary changes in two memory tasks. Psychonomic Science, 5(10), 371-372. [2] MathΓ΄t, S. (2013). A simple way to reconstruct pupil size during eye blinks. Available: http://dx.doi.org/10.6084/m9.figshare.688002.
For more information
[email protected] [email protected] in.bgu.ac.il/en/Labs/CNL/chap