Howdy, Stranger!

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

Supported by

[open] drift check

edited November 2013 in OpenSesame

Hi all,

Is there an easy way to show your own drift check screen instead of just 1 fixation point?

Thanks,

Martijn

Comments

  • edited November 2013

    Hi Martijn,

    pylink, and therefore also libeyelink which is built on top of it, uses a pretty complicated callback system for drawing things during drift correction, calibration, camera setup, etc. So an easy way? No not really I'm afraid.

    What you could do is modify the draw_cal_target() function in libeyelink.eyelink_graphics. This should be doable, but of course it means that you have to create different versions of libeyelink for each type of calibration target. This is a bit messy, but possible.

    Cheers!
    Sebastiaan

  • edited November 2013

    Thanks for your reply also to my other question, which I used to solve this problem. It turns out that it is relatively easy.

    I found the following information in the api user guide:
    doDriftCorrect(x, y, draw, allow_setup)

    Performs a drift correction before a trial.
    Parameters: <x, y>: Position (in pixels) of drift correction target. : If 1, the drift correction will clear the screen to the target background color, draw the target, and clear the screen again when the drift correction is done. If 0, the fixation target must be drawn by the user. : if 1, accesses Setup menu before returning, else aborts drift correction.
    Return value 0 if successful, 27 if ‘Esc’ key was pressed to enter Setup menu or abort

    My "hack":
    I draw my own custom drift check screen (multiple items on the screen), with a duration of 0ms.

    Next, I have an inline script with the following information:

    import pylink
    pylink.getEYELINK().doDriftCorrect(X,Y,0,1)
    

    The important things is that X&Y are in Eyelink coordinates (0,0) is the top left of the screen and not the center. So, if you want to do a drift check at the center, and your resolution is 1024 * 768, you should say:

    pylink.getEYELINK().doDriftCorrect(512,384,0,1)
    
  • edited 9:49AM

    Ah right, yes. I figured that calling doDriftCorrect() would automatically result in a call to draw_cal_target(). But indeed it doesn't, which makes things a lot easier.

    As a small tip, note that doDriftCorrect() can fail, so ideally you would implement this in a loop of the following type:

    c.show() # c should be a canvas with the drift target
    while not exp.eyelink.drift_correction( (x, y) ):
        exp.eyelink.calibrate()
        c.show()
    
  • edited 9:49AM

    Thanks for your help!

    I have the following problem at the moment: the experiments stops when I press escape during the 'custom' drift check using pylink. Is there a way to temporarily disable the escape key from exiting the experiment, but still to exit the drift check.

    Or, alternatively, can I assign another key to escape the experiment, let's say 'e' instead of 'escape', so I can keep using 'escape' for the drift check without exiting the experiment.

    Thanks,

    Martijn

  • edited 9:49AM

    Hi Martijn,

    You could catch the exception thrown by pylink.getEYELINK().doDriftCorrect() through a try ... except ... statement. However, the script I posted above already does this (thanks to @Wouter actually). so I would just use this libeyelink functionality.

    Cheers!
    Sebastiaan

  • edited 9:49AM

    Hi Sebastiaan,

    Thanks again for your help. Unfortunately I didn't completely understand your suggestion. So, I'm afraid I need a bit more help here. I tried the following, but this didn't work:

    import pylink
    
    c.show() # c should be a canvas with the drift target
    while not pylink.getEYELINK().doDriftCorrect(512,384,0,1)
        exp.eyelink.calibrate()
        c.show()
    
    

    Pressing escape (both on the opensesame and eyelink keyboard) still results in exiting the program. Should I try to change the while statement into this?

    while not pylink.getEYELINK().doDriftCorrect(512,384,0,1)==27
    

    (api user guide: Return value 0 if successful, 27 if ‘Esc’ key was pressed to enter Setup menu or abort)

  • edited 9:49AM

    Hi Sebastiaan,

    Just in general: can one disable escape to quit the experiment?

    Thanks,

    Martijn

  • edited 9:49AM

    Well, this is a bit of a spot-the-differences situation! You are using PyLink's doDriftCorrect(), whereas my example uses libeyelink's drift_correction(). This last function captures the Escape press.

    Just in general: can one disable escape to quit the experiment?

    No, that's hard-wired for the moment, although it is a question that occasionally comes up and is open for revision.

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