<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.n
        {mso-style-name:n;}
span.o
        {mso-style-name:o;}
span.s1
        {mso-style-name:s1;}
span.p
        {mso-style-name:p;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Dear all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have  been running an experiment using psychtoolbox to collect eyetracker data, using an Eyelink 1000+ eyetracker. The eyetracker triggers were sent using the command Eyelink(‘Message’,TRIGGER). The data were the converted to .asc format.<o:p></o:p></p>
<p class="MsoNormal">My goal was then to load the asci data using the ft_preprocessing(cfg) command from fieldtrip (see my code below). Then, in order to get the events, I use ft_read_event(fileName) command. However, none of the sent messages can be found
 in there, only the inputs. I could circumvent this issue by creating an event structure of my own by fetching the messages using the ft_read_header(cfg.dataset) and extracting the time stamps. I was however wondering whether there is way to get the messages
 as events directly. I suppose this depends on the structure of the asci file and hence on the way I set the eyelink file from the beginning on. You can find below my eyetracker code. Is there any way at all to have the messages to be considered as events directly,
 without having to go through the hustle of creating an event structure from scratch?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>Eyetracker initialization code:<o:p></o:p></b></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% Initializing eyelink</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Eyelink(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'Initialize'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% Initializes Eyelink and Ethernet system. Opens tracker connection, reports any problems.</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">%window (above) is the window you set with the function Screen(\91OpenWindow\92)</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">el = EyelinkInitDefaults(w);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% Setting the calibration background color to the same as during our</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% experiment.</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">el.backgroundcolour = [125 125 125];</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">EyelinkUpdateDefaults(el);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% Initialization of the connection with the Eyelink Gazetracker. Exit program if this fails.</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">%if ~EyelinkInit(dummymode, 1)</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue">if</span><span style="font-size:10.0pt;font-family:"Courier New";color:black"> ~EyelinkInit(Eyetrackerdummymode, 1)</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">    fprintf(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'Eyelink Init aborted.\n'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">    cleanup;</span><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% cleanup function</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">   
</span><span style="font-size:10.0pt;font-family:"Courier New";color:blue">return</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue">end</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% name and open file to record data to</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">edfFile = sprintf(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">‘ET%d.edf'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">,subjectNum);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Eyelink(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'Openfile'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">,
 edfFile);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% I am now specifying what event should be</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% recorded. In the output file, left and right eye fixation, saccade and</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% blinks will be recorded. Also, the messages, button press and inputs will</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% be recorded as events.</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Eyelink(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'command'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,INPUT'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% Setting the type of data to be recorded: Gaze for left and right</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% eye, area of the pupils.</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Eyelink(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'command'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'file_sample_data  = LEFT,RIGHT,GAZE,HREF,AREA,GAZERES,STATUS,INPUT'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal">Then the triggers are sent as follows:<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Eyelink(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'Message'</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">,
 trigger)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:12.0pt">Here is my code for the import of the data:</span></b><span style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Courier New";color:#70AD47">% Setting the file name<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">filename_eye = 'ET1.asc';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">cfg = [];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">cfg.dataset = filename_eye;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#70AD47">% Running the preprocessing command<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">data_eye = ft_preprocessing(cfg);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#70AD47">% Getting the events structure<o:p></o:p></span></p>
<pre><span class="n">event_eye</span><code> </code><span class="o">=</span><code> </code><span class="n">ft_read_event</span><span class="p">(</span><span class="n">filename_eye</span><span class="p">);</span><o:p></o:p></pre>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt">The event eye does not contain any of the messages that were sent as triggers, only the inputs.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Alex Lepauvre<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">PS: I unfortunately can’t share any data, due to data policies.
<o:p></o:p></p>
</div>
</body>
</html>