<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>​thanks for the help, have a nice day :)<br>
</p>
<div style="word-wrap:break-word; line-break:after-white-space">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Da:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> per conto di Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen@donders.ru.nl><br>
<b>Inviato:</b> venerdì 19 marzo 2021 08:48<br>
<b>A:</b> FieldTrip discussion list<br>
<b>Oggetto:</b> Re: [FieldTrip] help SR_eyelink+eeg data processing</font>
<div> </div>
</div>
<div>
<div class=""><font size="4" class="">Hi Umberto,</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<font size="4" class="">Well, my suggestion would be to write some code that is properly dealing with the events in fieldtrip style, and add this code to ft_read_event.</font>
<div class=""><font size="4" class="">Specifically, in the section of ft_read_event that deals with ‘eyelink_asc’ (line 1109 and beyond), add some code that deals with the relevant stuff that is present in hdr.orig.msg.</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">Rather than putting the events in a matrix, I’d put them in the same format as the typical events that fieldtrip can work with.</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">The way this is ideally done, is that you make the changes, and submit this changes (+an associated test script) as a so-called Pull Request on github. Some more information about our workflow can be found on <a href="https://www.fieldtriptoolbox.org/development/contribute/" class="">https://www.fieldtriptoolbox.org/development/contribute/</a> (and
 in the links therein).</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">Best wishes,</font></div>
<div class=""><font size="4" class="">Jan-Mathijs</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 19 Mar 2021, at 08:34, Cavallo, Umberto (Stud. FPN) <<a href="mailto:u.cavallo@student.maastrichtuniversity.nl" class="">u.cavallo@student.maastrichtuniversity.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">Thanks for the answer Jan,<br class="">
Yes I tried with ft read event, and I’ve tried with all frieldtrip tutorial instructions, but the problem is that the only events detected without using the code I sent are the first and last time stamp, thus to get all the triggers I can’t use ft read event.
 The only way it works is by storing them in a matrix. Maybe there is a way sto take the matrix with the stored event and store it into a cfg that allows me to use ft functions. Any suggestion?<br class="">
Best,<br class="">
Umberto
<hr tabindex="-1" class="" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">Da:</b> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> per conto di Schoffelen,
 J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>><br class="">
<b class="">Inviato:</b> venerdì 19 marzo 2021 08:08:08<br class="">
<b class="">A:</b> FieldTrip discussion list<br class="">
<b class="">Oggetto:</b> Re: [FieldTrip] help SR_eyelink+eeg data processing</font>
<div class=""> </div>
</div>
<div class="">Ciao Umberto, 
<div class=""><br class="">
</div>
<div class="">Have you tried ft_read_event?</div>
<div class=""><br class="">
</div>
<div class="">See <a href="https://www.fieldtriptoolbox.org/getting_started/eyelink/" class="">https://www.fieldtriptoolbox.org/getting_started/eyelink/</a></div>
<div class=""><br class="">
</div>
<div class="">Good luck,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 19 Mar 2021, at 06:42, Cavallo, Umberto (Stud. FPN) <<a href="mailto:u.cavallo@student.maastrichtuniversity.nl" class="">u.cavallo@student.maastrichtuniversity.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Dear All, <br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
i am doing an experiment in which i simultaneously acquire eeg data and SR eyelink eyetracker data. <br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
I still do not have eeg data, but i am trying to analyse my eyedata with fieldtrip since i will need this when i will  have eeg data too. <br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Due to the acquisition method the only way in which i can read the triggers from the eyedata is the following:<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
cfg = [];</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
cfg.dataset = filename_eye;</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
cfg.montage.tra      = eye(4)</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
cfg.montage.labelorg = {'1', '2', '3', '4'};</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
cfg.montage.labelnew = {'EYE_sample_numbers', 'EYE_HORIZONTAL', 'EYE_VERTICAL', 'EYE_DIAMETER'}</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
data_eye= ft_preprocessing(cfg);</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
hdr = ft_read_header(filename_eye);</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
event=[];</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
for evt=1:size(hdr.orig.msg,1)</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
    tmp=hdr.orig.msg{evt};</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
    ix=find(tmp==' ');</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
    if length(ix)==1</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
        event=[event;str2num(tmp(5:ix(1)-1)), str2num(tmp(ix(1):end))];</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
    end</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
end</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
​basically all my events are stored in the matrix EVENT, and my eye data are stored in the structure data_eye. <br class="">
I've tried to use built in functions to read events, however, they are not stored in cfg.event or anywhere else by using the classic fieldtrip functions. In fact, in this case the only event Fieldtrip read is the first timestamp and the last one, but not all
 the others.<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Given that everything besides my events (and their triggers), which are stored in a matrix, are stored in data_eye, could you help me in finding a way to use the analysis functions of fieldtrip (like ft_timelockstatistics for data analysis).Or a way in which
 i can manipulate my data storage to use fieldtrip functions?<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
thanks in advance.<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Best, <br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Umberto <br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
</div>
<span class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<span class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline!important">fieldtrip
 mailing list</span><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; background-color:rgb(255,255,255)">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; background-color:rgb(255,255,255)">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>