Howdy, Stranger!

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

Supported by

gaze/fixation-dependent start of trial


I am trying to adjust my open sesame experiment (working with an eyelink eye tracker) so each trial starts only after the subject has fixated the central fixation dot for 200 ms (100 samples):

  • If there is a 200ms fixation on the central dot I want to start the trial, with a delay of 50 ms.
  • If he/she does not I want the experiment to pause at the fixation display, with the possibility to recalibrate pressing "q".

With the pygaze_drift_correct tool does part of the job but I'm unable to control the timing of the fixation or how strict I want to be to accept a certain eye position as sufficiently close to the fixation point.

I hence tried the following inline script (at the start of the sequence element, before the tracker starts recording). It does not give compilation errors but it does not do what I want either. Even when the subject is fixating it stays stuck on the fixation till I press "q" two times in a row (first time to get into the calibration menu, second time to exit the calibration menu) and only then continues with the rest of the trial. What am I doing incorrectly? If anyone has example code for a fixation-contingent sequence they could share that would be helpful too.

Thank you very much,



checked = fix_triggered_drift_correction(pos=None, min_samples=100, max_dev=80, reset_threshold=30)

if checked == True :



print "recalibrate?" #for testing purposes



  • Hi Louisa,

    I don't know this function and what it does. But if it is sampling gaze position, you have to record, I think (though not sure). I did something similar in the past, and my code was in between start and stop recording (pygaze plugins). So, I suppose your experiment gets stuck in that function, because it doesn't get any gaze information, but that is just a hunch. If you wish, I can also share the code that I used to ensure fixation prior to a trial.


    Buy Me A Coffee

  • edited November 2019

    Thanks Eduard!

    Just moving my inline script doesn't work (the function fix_triggered_drift_correction is a pygaze function and gives an error when it is put after the start recording pygaze plugin).

    For now I have things working with a pygaze_drift_correct plugin before every trial, but it is more strict than I would like it to be. If you have code that allows one to specify how strict one wants to be to accept a certain eye position as sufficiently close to the fixation point, sharing it would be very helpful.


  • Hi Louisa,

    here the code I used, basically measuring the distance of the fixation to a reference location over some time.

    # check whether a fixation is on black ring in the beginning of the trial. Rather liberal
    # automatically continue unless no fixation occurred
    # dist() is a user-defined function measuring the euclidian distance between two dots 
    tw = clock.time()
    while dist((var.curfix_x+var.width*0.5,var.curfix_y+var.height*0.5),exp.pygaze_eyetracker.sample())>var.ROI:
       if clock.time()-tw >5000:
          var.accFix = 0


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