How to calibrate/validate eye tracker during a pause of an experiment (with EyeLink 1000 and iohub)?

898 views
Skip to first unread message

Chencan QIAN

unread,
Jul 17, 2013, 12:51:37 PM7/17/13
to psychop...@googlegroups.com
Hi, everyone~

I'm testing the new iohub module with EyeLink 1000. Impressive work indeed!

I do encounter a few practical problems, though. 

For example, I'd like to be able to evoke the built-in calibration/validation window whenever it is desired, even during the pause of the experiment, when a psychopy window is opened. At present, if I call tracker.runSetupProcedure()
before visual.Window(...), it works as expected. However, if a psychopy window is created first, calling runSetupProcedure() will open a new window, which doesn't respond to keyboard input (except for ESC) and won't draw anything when a calibration is initiated from EyeLink host PC. When pressing ESC, the calibration window closes and the remaining script goes on smoothly.

Did I miss something here?
Are there good demos or tutorials introducing how to manually implement a custom calibration procedure (drawing, communication with EyeLink, etc.)?

I didn't find good examples about pylink. Is that still the way to go given the new interface in iohub, if I need more communication than sending messages and getting samples?

Thank you for any information!

All the best

Chencan

Sol Simpson

unread,
Jul 17, 2013, 5:10:09 PM7/17/13
to psychop...@googlegroups.com
Hi Chencan,

>> However, if a psychopy window is created first, calling runSetupProcedure() will open a new window, 
>> which doesn't respond to keyboard input (except for ESC) and won't draw anything when a calibration 
>> is initiated from EyeLink host PC.

If you are seeing the blank eyelink setup mode screen right after runSetupProcedure() is called, then you should be able to press ENTER and /then/ 'c' to start calibration or 'v' to start validation. Escape or 'o' will exit the eyelink calibration mode and put you back to your main psychopy window. The unintuitive, but critical part right now, is the first step of hitting ENTER first, then keys other than ESC should work as expected.

Since ESC is working for you my guess is that is what the issue is, and if you press enter first it will work. Before hitting ENTER the eyelink is not actually in setup mode yet so keys like 'c' and 'v' do not work.
 
Let me know if you that does not solve the issue and we can take troubleshooting further.

If you look in the psychopy.iohub.devices.eyetracker.hw.sr_research.eyelink module directory, there is a file called eyeLinkCoreGraphicsIOHubPsychopy.py which is what implements the eyelink calibration callbacks using psychopy graphics. The camera image screen is not yet implemented, thus why you have to hit the extra ENTER key when you go into the  runSetupProcedure() before keys other than ESC have any effect.

Thanks very much,

Sol

Chencan QIAN

unread,
Jul 17, 2013, 9:56:42 PM7/17/13
to psychop...@googlegroups.com
Hi Sol, 

Long time no see:) I'm glad to see that iohub is now integrated as part of psychopy.

I'm afraid the issue is not that straightforward. I did remember to press ENTER to enter Camera Setup mode before C/V/O is available, just like in any other routine (e.g., track.exe) provided by EyeLink.
My previous description of the symptom is not accurate: actually, the calibration window does respond to ENTER (the host PC changes to Camera Setup mode, which implies the communication between stimulus and host PC is successfully established), and C followed by SPACE (the host PC actually starts to collect data points). The problem is that no text or figures are drawn on the newly opened calibration window, so that it feels like not responding.

Since there are two windows opened at the same time (i.e., experiment window and calibration window), is it possible that the drawing is directed to the experiment window, which is occluded by the blank calibration window, so that the result is not visible? Or maybe the two windows interfere each other so that any drawing will fail?

I've dug into eyeLinkCoreGraphicsIOHubPsychopy.py before. However, it looks difficult for me to read without the help of some document about all those class methods, function signatures, etc.
Are there such documentation for pylink?

Sol Simpson

unread,
Jul 18, 2013, 12:20:13 PM7/18/13
to psychop...@googlegroups.com
Hi Chencan,

Thanks for the update.

>>  is it possible that the drawing is directed to the experiment window, which is occluded by the blank calibration window

This is not possible, but the opposite is. ;) i.e, the psychopy experiment window could be occluding the initial calibration window, while the iohub keyboard events are still being sent to the calibration window that you can not see.

When you call 'runSetupProcedure', is your experiment window blank before calling 'runSetupProcedure' ? My guess it is.

The work around I have found for cases where the calibration window is hidden by the experiment window (it does not happen on all computers / graphics cards / OSs , not sure what the variable is that makes the issue occur or not) is to add the following code before and after each time you call runSetupProcedure(), assuming 'self.window' in the code below is holding the psychopy experiment window, and 'eyetracker' is holding the hub.devices.eyetracker device:

# minimize the psychopy experiment window
#
self.window.winHandle.minimize()

# call the iohub eye tracker calibration / setup routine
#
eyetracker.runSetupProcedure()

# restore the psychopy experiment window
#
self.window.winHandle.maximize()
self.window.winHandle.activate()

I have only tried this on windows, but in the cases where the issue that I think you are reporting has occurred, this fixes the issue.

Please let me know if it also fixes the issue for you. 

Thanks again,

Sol

Chencan QIAN

unread,
Jul 18, 2013, 9:26:16 PM7/18/13
to psychop...@googlegroups.com
You're right! 
And the solution solves my problem :D

Thank you very much, Sol!

For reference, I have a dell optiplex 380 with nvidia geforce 310, windows 7 64-bit, psychopy 1.77.01 standalone, two monitors in extended mode.

BTW, I guess these winHandle.minimize stuff are undocumented features?

Sol Simpson

unread,
Jul 19, 2013, 7:11:46 AM7/19/13
to psychop...@googlegroups.com
That is great to hear. Since the issue occurs frequently enough, we may consider adding a keyword argument option to the runSetupProcedure() method that can be used to have the experiment window minimized and then maximized and activated after the method runs. Have to think about it a bit.

Take care,

Sol

Egor Ananyev

unread,
Sep 9, 2016, 1:19:05 AM9/9/16
to psychopy-users
Dear Sol,

I'm sorry for this egregious necrobump, but could I seek your assistance on a similar unresponsive keyboard issue described here:
http://discourse.psychopy.org/t/iohub-eyelink-unresponsive-keyboard-during-calibration/1023
?

Thanks in advance for any help.

Best,
--Egor
Reply all
Reply to author
Forward
0 new messages