[open] drift check
Hi all,
Is there an easy way to show your own drift check screen instead of just 1 fixation point?
Thanks,
Martijn
Hi all,
Is there an easy way to show your own drift check screen instead of just 1 fixation point?
Thanks,
Martijn
Comments
Hi Martijn,
pylink, and therefore alsolibeyelinkwhich 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 inlibeyelink.eyelink_graphics. This should be doable, but of course it means that you have to create different versions oflibeyelinkfor each type of calibration target. This is a bit messy, but possible.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
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:
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:
Ah right, yes. I figured that calling
doDriftCorrect()would automatically result in a call todraw_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:Check out SigmundAI.eu for our OpenSesame AI assistant!
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
Hi Martijn,
You could catch the exception thrown by
pylink.getEYELINK().doDriftCorrect()through atry ... except ...statement. However, the script I posted above already does this (thanks to @Wouter actually). so I would just use thislibeyelinkfunctionality.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
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:
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?
(api user guide: Return value 0 if successful, 27 if ‘Esc’ key was pressed to enter Setup menu or abort)
Hi Sebastiaan,
Just in general: can one disable escape to quit the experiment?
Thanks,
Martijn
Well, this is a bit of a spot-the-differences situation! You are using PyLink's
doDriftCorrect(), whereas my example uses libeyelink'sdrift_correction(). This last function captures the Escape press.No, that's hard-wired for the moment, although it is a question that occasionally comes up and is open for revision.
Check out SigmundAI.eu for our OpenSesame AI assistant!