Howdy, Stranger!

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

Supported by

Show backdrop image on EyeLink host with pygaze

Hi,

I am using OpenSesame with pygaze to connect with an EyeLink eyetracker and so far it's working great!

I just have a question regarding setting backdrop image. EyeLink provides a plugin with methods bitmackBackdrop:

img = PIL_Image.open(image_path)

w,h = img.size

im_pixels = img.load()

# use the list comprehension trick to convert all image pixels into a <pixel> format

# supported by the Host PC, pixels = [line1, ...lineH], line = [pix1,...pixW], pix=(R,G,B)

pixels = [[im_pixels[i, j] for i in range(w)] for j in range(h)]

# call the bitmapBackdrop() command to show backdrop image on the Host

# arguments: width, height, pixel, crop_x, crop_y, crop_width, crop_height, x, y on Host, option

pos_x = int(var.width/2.0 - w/2.0)

pos_y = int(var.height/2 - h/2.0)

exp.eyelink.bitmapBackdrop(w, h, pixels, pos, 0, w, h, pos_x, pos_y, pylink.BX_MAXCONTRAST)

and imageBackdrop:

exp.eyelink.imageBackdrop(image_path, 0, 0, scn_width, scn_height, pylink.BX_MAXCONTRAST)

to send a backdrop image to EyeLink host. I saw that this eyelink plugin was discontinued in favor of pygaze, but could not find an equivalent in pygaze documentation.

Do such methods exist in pygaze?

Thanks for your help.

Best regards,

Jessica

Comments

  • Hi Jessica,

    When you say "Eyelink provides such a functionality" do you mean the pylink library? Or the old Eyelink plugins? It looks like Pygaze hasn't implemented that option. Still, if that option exits in pylink( which I think does), you will probably be able to access it somehow and project your image to the eye tracker, but there is a chance that this will be a bit complicated, depending on how this method is implemented. I don't have access to the Pylink library at the moment, so I can't look into it unfortunately. If you can provide me with that info, I might be able to give a somewhat more informed guess on whether and how it is possible, though not having access to an eyetracker is still a problem...

    Eduard

    Buy Me A Coffee

  • edited March 2023

    Hi @eduard ,

    Thanks for your answer. Indeed, I was able to call the pylink method to send image to the eyetracker host.

    import pylink
    
    import PIL.Image as PIL_Image
    
    
    def set_backdrop(im, pos_x):
    
        starttime = exp.time()
    
        # prepare image
    
        img = PIL_Image.open(im)
    
        w,h = img.size
    
        im_pixels = img.load()
    
        # use the list comprehension trick to convert all image pixels into a <pixel> format
    
        # supported by the Host PC, pixels = [line1, ...lineH], line = [pix1,...pixW], pix=(R,G,B)
    
        pixels = [[im_pixels[i, j] for i in range(w)] for j in range(h)]
    
        pos_x = int(var.width/2 + pos_x - 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)
    

    And I call this function doing:

    set_backdrop(image_path, pos_x)
    

    I only alter pos_x since my images are vertically centered. But for other experiments where this is not the case, a pos_y argument could be added, and pos_y could be altered in the function similarly to what is done to pos_x.

    Best,

  • Great! Good to know and good luck testing!

    Eduard

    Buy Me A Coffee

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