Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Eyelink plugin: Logging variables and saving images

edited January 2014 in OpenSesame

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

  • edited 4:40PM

    Hi Frouke,

    Assuming that the filename of the picture is a variable in OpenSesame, and assuming that you use a logger item with the option 'Automatically detect and log all variables' enabled, the picture name will be automatically logged to the .csv file (i.e. the OpenSesame log file). To also log the picture filename to the .edf file (i.e. the EyeLink log file), you can use the eyelink_log plug-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 IMGLOAD message to the EyeLink log file. In the DataViewer manual (available on http://www.sr-support.com/) this is described as follows:

    7.3.3.1 Image Loading – Fill Full Screen
    Identifier: FILL
    Description:
    This message specifies the image to be used as the background for the spatial overlay view of a trial within the viewer. The image is sized to fit the dimensions specified in the DISPLAY_COORDS command message. The image should be represented as a relative path. The viewer will look for the image in the following order:
    
    1) In the default image directory specified in the general preference settings.
    2) In the directory the EyeLink data file is loaded from.
    3) In the directory the viewer application is running from.*
    
    Format:
    !V IMGLOAD FILL <relative_image_path>
    Example:
    MSG 3388468 !V IMGLOAD FILL Sac_blur.jpg
    

    So, let's assume that in OpenSesame the picture filename is available as the variable pic. Then you can use the following command in the eyelink_log plug-in:

    !V IMGLOAD FILL [pic]
    

    In an inline_script you can accomplish the same thing as follows:

    exp.eyelink.log('IV IMGLOAD FILL %s' % self.get('pic'))
    

    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

  • edited 4:40PM

    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

  • edited 4:40PM

    The PyGaze plug-ins work in the same way, but the instance for tracker communications is named slightly different:

    exp.pygaze_eyetracker.log("this ends up in the EDF")
    

    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.

  • edited July 2014

    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:

    1. if we use exp.pygaze_eyetracker.log we do not need the pygaze_log plug in right?

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

  • edited 4:40PM

    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.log within 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!

  • edited 4:40PM

    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!

  • edited July 2014

    Hi Olya,

    Replace exp.eyelink with exp.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.sentence exists

    Best,
    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 :)

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games