Howdy, Stranger!

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

Supported by

[open] Define fixation start parameters

edited February 2016 in OpenSesame

Hi,
I'm really new to OpenSesame, and not particularly proficient in Python but I've been able to do pretty much everything I've needed to so far through the GUI. I'm getting stuck with setting a trial to start and end based on fixation at a specific location (I want the trial to begin with fixation at pos x,y and end with a fixation at pos x',y'). I've been looking for an example of the inline code used to do this - the GUI seems to provide the basic functionality for this through the py_gaze_wait button - but in terms of defining the specific parameters (namely, where the gaze needs to be located to continue and for how long) I'm pretty lost. Also, I've read through the pygaze function list and I do see that fixation start/end are included but again, not sure how to implement them inline and I saw that a similar question was asked a few years ago: http://forum.cogsci.nl/index.php?p=/discussion/577/solved-eye-tracking-experiment-question-gaze-contingent-stimuli-presentation/p1, but again the implementation is a little beyond me + it seems like the functionality of OS has greatly expanded since? Apologies if this is a super basic/redundant query!

Thank you!

Comments

  • edited 5:25AM

    Hi,

    I don't know whether you can do what you want just with the GUI. I personally, am using mostly inline_scripts. However, you don't need to worry. The script you would have to write is rather simple. It basically boils down to sampling eye positions, and check whether they lie in any of your defined target regions. Of course, you could do it in more sophisticated ways, but this example provides you with the basic logic. You can look up other commands from the website.

    Btw. The link you mentioned in your post, is rather outdated. It might still be working, but in the meantime there is a more powerful and better approach (pygaze).

    So, here is the example:


    # define some arbitrary ROI startx = 0 starty = 0 endx = 400 endy = 0 tolerance = 20 def dist(x1,y1,x2,y2): # function to compute the Euclidian distance between two points return math.sqrt((x2-x1)**2 + (y2-y1)**2) t1 = clock.time() while True: # sample current eye position ex,ey = exp.pygaze_eyetracker.sample() # measure distance between target region and current position if dist(endx,endy,ex,ey)< tolerance: print 'Fixated target' break # 5 seconds timeout if clock.time()-t1 >5000: break

    I hope this helped. Let me know, if you need more explanation.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 5:25AM

    Hi Eduard,

    Thank you, that's very helpful. But one main thing:
    I'm still not totally clear on how to integrate the code you provided with the rest of the experiment. To summarize: I'm going to have stimuli (images) at both the start and end eye-position (basically one image in the center and 4 images in the periphery and the images are going to be randomized as well as which peripheral location needs to be looked at to end the trial). I can integrate the images and randomize their location into a sketchpad, and I can probably figure out how to randomize the 'endx, endy' vars, but I'm having trouble integrating the two. Again I apologize as I'm sure if I had a more robust coding background I'd be able to do this with ease.

    Thank you!

  • edited 5:25AM

    Also, when I tried to test run it, it said that it couldn't find the 'math' function?

  • edited February 2016

    Hi,

    Sorry for the last response, I was quite busy recently...

    it said that it couldn't find the 'math' function

    Again sorry. This package needs to be imported before you can use it. Just add import math in the beginning of your inline_script.

    Regarding your first question, the code I provided, is basically what happens during a trial. In particular, the whileloop is what is characteristic for a trial. The stuff before (when I defined the ROI), is what you probably want to set in your loop. If you manage to present your stimuli, in the way you described, you just have to add the code of me in an inline_script as next element in the sequence and you should be done (at least as far as I understand your experiment). So, something like that seems to be alright:

    • block_sequence
    • trial_sequence
      • Show stimuli (one or multiple sketchpad)
      • Monitor eye movements and do stuff once a specific eye movement occurred (inline_script)

    Does this make sense?

    Eduard

    Buy Me A Coffee

  • edited 5:25AM

    Hi Eduard,

    Thanks for your help! Apologies for not getting back. I will test it out sometime in the future and get back to you. Thank you again!

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