Howdy, Stranger!

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

Supported by

Eye-Tracking with EyeLink: How to set backdrop on host PC?

Dear all,

I want to do a reading experiment where each trial consists of the following:

  1. they see the stimulus: a sentence [pretarget][target][posttarget] in a sketchpad
  2. they have to press space to continue to the question
  3. a yes and no question is shown [question] in a sketchpad
  4. they have to answer the question by either pressing "d" for yes or "l" for no

I use the PyGaze Plugins with an EyeLink Portable Duo. The experiment runs without a problem, but I can see neither see the sentence nor the question on the host PC (or in the Data Viewer afterwards). I know, I have to use an inline script to set the backdrop, but all my tries haven't worked out so far. Currently, I am using this script, placed in the trial before the drift correct and in the run phase:

bd_s= self.copy_sketchpad("sentence")

exp.pygaze_eyetracker.set_backdrop(bd_s)

I get the follwing error message: AttributeError: 'libeyelink' object has no attribute 'set_backdrop'

I am not really able to program at all and also new to Open Sesame and Eye-Tracking. How could I solve the problem of setting the backdrop?

And one additonal question: Ideally, I would also like to see the question after the sentence, but I really do not know how to do this. It is not strictly necessary for my experiment, but I would like to implement this as well when it is not too complicated.

Many thanks in advance!

Vanessa

Comments

  • Hi Vanessa,

    Have you seen this discussion:

    It sounds like @Jessica Bourgin managed to set the backdrop fine. She also shared the code that worked for her.


    Ideally, I would also like to see the question after the sentence, but I really do not know how to do this.

    Not sure what exactly you mean here. Do you mean to set the backdrop both for the sentence, as well as for the question? That shouldn't be a problem if you can get one to work, the other would work the same way. Or am I misunderstanding?

    Hope this helps,

    Eduard

    Buy Me A Coffee

  • edited May 2023

    Hi Eduard,

    thank you for your reply! I had seen this discussion, but was not sure how I could implement this for my own/if I could use it at all, as I do not have a set image but my sketchpad that varies from trial to trial (and -as I said - I am not able to program at all).I have now just copied the whole script and it says that my pos_x is not defined. I assume that I have to somehow adjust this

    img = PIL_Image.open(im)
    w,h = img.size
    im_pixels = img.load()
    

    so it works with the sketchpad. How would I do that? What would be the width and height for a sketchpad and can I just change that hard coded like : h = xxxx and w=xxxx? Maybe I could use the resolutions of my PC? Sorry for my very unknowledgable questions!


    My second question was meant like this: I have to put the inline script for the backdrop at the very front of the trial. So, how can I define in the script that the sentence shows up until the space bar is pressed and after that the backdrop should change to the question. But I can understand if this question is to specfic and you do not want to write just code for me! ;) As I said, it is not strictly necessary.

    Regards,

    Vanessa

  • edited May 2023

    Quick update: I got the script running and it shows now a grey backdrop (instead of the standard black one) but unfortunately I can not see the sentence as well. Do you have any idea why this could be?

    This is now my script:

    bd_s = self.copy_sketchpad("sentence")
    import pylink
    import PIL.Image as PIL_Image
    def set_backdrop(im, pos_x):
    im_pixels = img.load()
    img = PIL_Image.open(im)
    starttime = exp.time()
    w = 1920
    h = 1080
    pixels = [[im_pixels[i, j] for i in range(w)] for j in range(h)]
    pos_x = int(var.width/2.0 - w/2.0)
    pos_y = int(var.height/2 - h/2.0)
    el = pylink.getEYELINK()
    el.bitmapBackdrop(w, h, pixels ,0 , 0, w, h, pos_x, pos_y, pylink.BX_MAXCONTRAST)
    set_backdrop(bd_s, pos_x)
    

    Many thanks in advance,

    Vanessa

  • Hi Vanessa,

    Yeah, I see. You would need to extract the individual RGBA values for each pixel from your canvas. I had a quick look, but couldn't find an easy way to extract these pixels values from a canvas. @sebastiaan is there an easy way?

    It would be easier, if you could provide your sentences as image stimuli. Would that be feasible for your specific experiment?

    Eduard

    Buy Me A Coffee

  • Hi @vanessadcx and @eduard ,

    There is no easy way to set the OpenSesame canvas as a backdrop on the EyeLink PC. Indeed, as Eduard says, the most practical way would be to use bitmaps for the stimuli and then send these bitmaps to the EyeLink using the pylink API, as you're already doing in the example.

    — Sebastiaan

  • Hello Eduard, hello Sebastiaan,

    many thanks for your help! I' ve now solved my problem using images instead of text and switching to the eylink plugins.

    Regards,

    Vanessa

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