[open] Define fixation start parameters
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
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:
I hope this helped. Let me know, if you need more explanation.
Good luck,
Eduard
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!
Also, when I tried to test run it, it said that it couldn't find the 'math' function?
Hi,
Sorry for the last response, I was quite busy recently...
Again sorry. This package needs to be imported before you can use it. Just add
import mathin the beginning of yourinline_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 yourloop. If you manage to present your stimuli, in the way you described, you just have to add the code of me in aninline_scriptas next element in thesequenceand you should be done (at least as far as I understand your experiment). So, something like that seems to be alright:sketchpad)Does this make sense?
Eduard
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!