[solved] Eyelink plugin: Logging variables and saving images
These may be two very easy questions to answer. We wrote a program to show an image (jpg or bmp) on each trial while recording people's eye movements. Our questions are: Would there be a way to log the name of the image to the EDF (ASC) file or to the CSV file? When viewing the EDF with the DataViewer, the image does not seem to be presented. Is there a way to make it visible?
Thanks!

Comments
Hi Frouke,
Assuming that the filename of the picture is a variable in OpenSesame, and assuming that you use a
loggeritem with the option 'Automatically detect and log all variables' enabled, the picture name will be automatically logged to the.csvfile (i.e. the OpenSesame log file). To also log the picture filename to the.edffile (i.e. the EyeLink log file), you can use theeyelink_logplug-in and similarly enable the 'Auto-detect and log all variables' option.However, to make sure that the EyeLink DataViewer actually recognizes and shows the image, you need to write a special
IMGLOADmessage to the EyeLink log file. In the DataViewer manual (available on http://www.sr-support.com/) this is described as follows:So, let's assume that in OpenSesame the picture filename is available as the variable
pic. Then you can use the following command in theeyelink_logplug-in:In an
inline_scriptyou can accomplish the same thing as follows:Of course you will need to make sure that the DataViewer can find the image file as described in the DataViewer manual (see above).
Hope this helps!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hello Sebastiaan,
we are using PyGaze plug-in for our fMRI/eye tracker experiment (it consists of a unique inline_script). The experiment sequence is as follows:
1. calibration 2. start recording 3. inline_script 4. stop recording
We want to send messages to the EDF file to map what is happening in the experiment. Can we use exp.eyelink.log function in the inline_script? Or is there a specific command for PyGaze (we did not find it in PyGaze website)?
In a tutorial you say that this function is especially useful if multiple events of interest are handled by the same inline_script item, which is exactly our case.
Thanks for your help.
Cheers, Stefania & Ambra
The PyGaze plug-ins work in the same way, but the instance for tracker communications is named slightly different:
BTW: The PyGaze plug-ins are still in a testing stage. You are advised to use the latest code snapshot from GitHub, and to test your experiment thoroughly to avoid any unwelcome surprises.
Hi Edwin,
thanks for your reply, we have put the code in the inline_script. We haven't tried the script yet, anyway we have two more questions:
if we use exp.pygaze_eyetracker.log we do not need the pygaze_log plug in right?
do we have to import any libraries at the beginning of the experiment?
We will try the script in the next days and update the discussion.
Thanks for your help.
Cheer,
Stefania & Ambra
Hi guys,
In the graphical environment, you can use the pygaze_log plug-in to log a message to the EDF file. The exact same is achieved using
exp.pygaze_eyetracker.logwithin an inline_script.For both, you needn't import anything at the start of your inline_script. You will have to place a pygaze_calibrate item at the start of your experiment, though!
Good luck!
Hi,
What would be the equivalence of this line if I am using pygaze?
exp.eyelink.log('IV IMGLOAD FILL %s' % self.get('pic'))
I am using the pygaze-log plug in and I wanted to put this line in the inline script after sketchpad to make sure my images load into DataViewer correctly.
Thank you!
Hi Olya,
Replace
exp.eyelinkwithexp.pygaze_eyetracker, and everything should work the same.Good luck!
Hello,
I realise this discussion might be closed down by now, but I hope to still find some answers here.
I'm having the same difficulties as described in the first post, except that I'm using text (sentences) and not images. So my problem is that when viewing the EDF with the DataViewer, the sentences that the participants read during the experiment are not presented.
For the experimental setup, I am importing the sentences from the .txt file in an inline script.
I would really appreciate any help on how to make them load into DataViewer. If relevant, I'm using the pygaze_log plug-in.
Thanks for your help!
Katarina
Hi Katarina,
I guess you could use something like:
exp.pygaze_eyetracker.log("!V SENTENCE %s" % var.sentence)In your inline_script assuming your
var.sentenceexistsBest,
Jarik
PS I'm not a pygaze expert nor did I test the code above. Searching the forum for "exp.pygaze_eyetracker.log" might get you further