PANDA tutorial, for students and coworkers: analysis of eye- and head-position signals.
Saccades are stereotyped and rapid eye movements. Saccade velocity and duration can tell us something about how the saccade is programmed and controlled by the brain. In this tutorial, you will analyze saccade parameters from eye movements during a sound-localization experiment.
After detecting saccades, we can start analyzing the saccades/movements. Often, you will want to write your own analysis routines. In what follows, some general basic principles are given that are most commonly used in the analysis of eye and head movements.
In the analysis of measured responses, the saccade- and the stimulus matrices, both stored in the MAT-files (see the previous chapter) are often needed. As soon as the MAT files have been generated with
pa_sac2mator unzipped from an existing ZIP file, the MAT files can be loaded into MATLAB’s workspace. For example, if you need the data from XX-SS-YYYY-MM-DD-0001.mat, you type:
Two matrices will now be stored in the workspace. You may verify this by typing the MATLAB command:
Both the Stim and the Sac matrices will be listed:
In each row of the Sac matrix all saccade parameters of one particular saccade are stored. Each column of the Sac matrix represents one particular parameter for all saccades. In Appendix B the saccade parameters of each column are all listed. The table in Appendix B can also be obtained in MATLAB by typing:
Below, an example is given of a Sac matrix, for which only the first five columns are listed:
Row Trial Number Saccade number Onset Offset Latency … 1 1 1 310 340 220 … 2 1 2 460 470 520 … 3 2 1 320 360 240 … 4 3 0 220 244 40 … 5 3 1 380 400 360 … 6 4 1 294 340 188 … 7 4 2 450 466 500 … 8 6 1 300 342 200 … Column 1 2 3 4 5 …
Thus, saccades from the same trial, but also from consecutive trials are listed in subsequent rows. The order is the same as was found by the detection algorithm (see pa_sacdet). In the first and second columns, one can see that trials 1, 3 and 4 had more than one detected saccade, each with their own number, whereas in trials 2 and 6 only one saccade was detected. Trial 5 is omitted from the list, because there was no saccade detected in that trial. Note that the first saccade of the third trial has received ranking number zero. The reason for this is that its latency was below 80 ms, in which case it can not be regarded as a stimulus-evoked saccade.
In each row of the Stim matrix all stimulus parameters of one particular trial are stored. Each column of the Stim matrix represents one particular parameter for all trials. In Appendix B the stimulus parameters of each column are all listed. The table in Appendix B can also be obtained in MATLAB by typing:
Below, an example is given of a Stim matrix, for which only a part of the columns is listed:
Row Trial Number Target Number Mode Azimuth Elevation Eccentricity … 1 1 2 0 0 0 0 … 2 1 3 1 20 30 37.2855 … 3 2 2 0 0 0 0 … 4 3 2 0 0 0 0 … 5 3 3 1 2 0 2 … 6 3 4 4 15 40 43.8631 … 7 4 2 0 0 0 0 8 4 2 1 2 30 30.1809 9 5 2 0 0 0 0 10 5 2 1 40 10 41.7460 11 6 2 0 0 0 0 12 6 2 1 -20 5 20.6679 Column 1 2 3 4 5 …
Again, subsequent trials are listed below one another, as are the parameters of subsequent stimuli within each particular trial. The first column tells us that there have been three trials, whereas the second column indicates that there have been a various number of stimuli per trial. In trial 1, the first stimulus (Target Number 2, as nr 1 is reserved for data acquistion start), a visual fixation point at the center of FART (Mode = 0,column 3), Azimuth and elevation both 0, (columns 4 and 5). The second stimulus was a peripheral target (columns 4 and 5) and was an auditory target (Mode = 1). Trial 3 had 3 stimuli (Column 1), of which the First was visual (Mode = 0), the second was auditory (Mode = 1) and the third was a skyLED (Mode = 4). Note that, as a rule, the Sac and Stim matrices do not have an equal number of rows, since each trial may contain any number of detected saccades. In the analysis it is therefore important to keep this in mind, and always find a way to associate a given saccade with the correct trial number and stimulus events. Below, some hints are given on how to achieve this.
After loading the appropriate Sac and Stim matrices, the first step is typically some kind of selection procedure. For example, in your analysis you may be interested in the primary saccade responses toward the stimulus in each trial only, and to disregard the correction saccades. In MATLAB such a procedure is readily implemented through the use of so-called selection vectors, or with index vectors. The definition of the selection criteria is most often implemented as a logical statement, involving logical operators like & (AND), || (OR), == (EQUAL), > (LARGER), < (SMALLER), etc.
Suppose you want to select all primary saccades. An appropriate selection vector for primary saccades is created by looking at the saccade number in the Sac matrix (column 2). Type:
selp = (Sac(:,2)==1);
The selection vector is a column vector, containing the SAME number of rows as the Sac matrix, in which the values are only zero (the logical operation was FALSE) and ones (when TRUE). For our previous example this would yield:
Selection Trial Number Saccade number Onset Offset Latency … 1 1 1 310 340 220 … 0 1 2 460 470 520 … 1 2 1 320 360 240 … 0 3 0 220 244 40 … 1 3 1 380 400 360 … 1 4 1 294 340 188 … 0 4 2 450 466 500 … 1 6 1 300 342 200 … Column 1 2 3 4 5 …
Now suppose that you are interested in the latency of the primary saccades (column 5). By using the selection vector, sel, it is straightforward to generate a Lat vector with only the latencies of the primary saccades, as follows:
Lat = Sac(selp==1,5);
In plain language, this command says: “Return all values from the fifth column of the Sac Matrix (containing the latencies) from those rows for which the corresponding row in the sel vector equals 1”. The values of the Lat vector are therefore:
Lat=[220, 240, 360, 188, 200]
An alternative way to achieve the same result as in the previous example is by using an index vector. The MATLAB command
indx = find(Sac(:,2)==1);In plain language: “provide the row_indices for the second column in matrix Sac whenever the value is equal to one”. The result of this operation yields the rows in which the primary saccades are listed:
indx = [1,3,5,8]Subsequently type:
Lat = Sac(indx,5);
yielding exactly the same Lat vector. Both methods yield entirely equivalent results, although MATLAB is slightly faster with selection vectors.
Typically, saccades have a reasonably short latency, around 200 ms. When the latencies are much longer than that, this is an indication that the subject is not very alert, and therefore may respond in an otherwise sloppy way. For this reason it is often desirable to add an extra criterion to selected saccades, namely to exclude saccade responses with latencies exceeding, say, 350 ms. To create a selection vector or, alternatively, an index vector for this criterion type:
selt = (Sac(:,5)<=350); indx = find(Sac(:,5)<=350);The latencies of the saccades in our example that fulfill the 350 ms criterion are generated by one of the following commands:
Lat = Sac(selt,5); Lat = Sac(indx,5);The result is (check for yourself):
Note, that the saccade with the 40 ms latency is now also included. This is the saccade with rank number 0 in trial 3. If you want to select:
both selection criteria should be applied together. By far the simplest way to achieve this is to combine the selection vectors into a new selection vector:
sel = selp & selt
The resulting vector now contains a 1 only when both the selp vector and the selt vector contain a 1 in the same row. The final selection that meets our goals is therefore:
Lat = Sac(sel==1,5);
with the result:
Note that it is relatively simple to combine selection vectors in order to impose several simultaneous constraints onto your data. The index vector is not a very useful tool for combining different criteria.