[FieldTrip] Eyetracker messages and events.

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Fri Nov 8 13:11:42 CET 2019


Dear Alex,
You might want to consider reading in a bit more detail the relevant code in ft_read_event (look for ‘eyelink_asc’).
There you will see what is implemented to return the information in the way you report. I suspect that you also want to read in more detail the function read_eyelink_asc (in fieldtrip/fileio/private). It seems that the string ‘MESSAGE’ is not parsed (as opposed to other possible strings, such as ‘MSG’). I think one solution could be to add an extra elseif statement that identifies ‘MESSAGE’ in a regular expression.
Could you please try this, and if it works send a Pull Request on github?

Thanks and best wishes,
Jan-Mathijs


On 8 Nov 2019, at 12:14, Lepauvre, Alex <alex.lepauvre at ae.mpg.de<mailto:alex.lepauvre at ae.mpg.de>> wrote:

Dear all,

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.
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?

Eyetracker initialization code:
% Initializing eyelink
Eyelink('Initialize');
% Initializes Eyelink and Ethernet system. Opens tracker connection, reports any problems.
%window (above) is the window you set with the function Screen(\91OpenWindow\92)
el = EyelinkInitDefaults(w);
% Setting the calibration background color to the same as during our
% experiment.
el.backgroundcolour = [125 125 125];
EyelinkUpdateDefaults(el);
% Initialization of the connection with the Eyelink Gazetracker. Exit program if this fails.
%if ~EyelinkInit(dummymode, 1)
if ~EyelinkInit(Eyetrackerdummymode, 1)
    fprintf('Eyelink Init aborted.\n');
    cleanup;% cleanup function
    return;
end
% name and open file to record data to
edfFile = sprintf(‘ET%d.edf',subjectNum);
Eyelink('Openfile', edfFile);

% I am now specifying what event should be
% recorded. In the output file, left and right eye fixation, saccade and
% blinks will be recorded. Also, the messages, button press and inputs will
% be recorded as events.
Eyelink('command', 'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,INPUT');
% Setting the type of data to be recorded: Gaze for left and right
% eye, area of the pupils.
Eyelink('command', 'file_sample_data  = LEFT,RIGHT,GAZE,HREF,AREA,GAZERES,STATUS,INPUT');
Then the triggers are sent as follows:
Eyelink('Message', trigger)


Here is my code for the import of the data:
% Setting the file name
filename_eye = 'ET1.asc';

cfg = [];
cfg.dataset = filename_eye;
% Running the preprocessing command
data_eye = ft_preprocessing(cfg);

% Getting the events structure

event_eye = ft_read_event(filename_eye);


The event eye does not contain any of the messages that were sent as triggers, only the inputs.

Kind regards,

Alex Lepauvre

PS: I unfortunately can’t share any data, due to data policies.
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191108/576c186e/attachment.html>


More information about the fieldtrip mailing list