[visionegg] Re: newbie question about GUI experiments

Dear Steven,

You're right that the Vision Egg doesn't seem to be the right tool for your job. I think a standard GUI (I suggest wxPython) toolkit is a good starting point. Unfortunately getting accurate timestamps from keypresses and mouse clicks is not an area I have great expertise with (since I've studied mainly insects, which aren't necessarily very amenable to this sort of experimentation :). Below are a few thoughts on the matter.

To state the obvious, the first potential loss of accuracy will be at the operating system level. In most cases, the computer hardware has buffers that fill with events and the kernel checks these when it can, which is generally with indeterminate latency but is usually very short (microseconds). If the original data source includes its own timestamp (USB may do this -- I can't remember with certainty) it may be possible that the operating system preserves this data. Otherwise, the best accuracy one may get is limited by how often the OS checks the hardware buffers and the resolution of the timestamp it assigns to the corresponding event.

I don't know of any methodologies for determining the temporal error in measuring keypress/mouse-click times with standard (e.g. USB) devices, but if anyone knows, we'd appreciate a reference. Certainly commercial button-boxes have worked out these issues, but I'd be (pleasantly) surprised if this was accomplished while the device acts as a standard USB keyboard or mouse.

The only other "GUI toolkit" I might suggest would be something built on SDL (or pygame, which is basically pySDL). I suggest this because SDL would probably be your best bet (down the track) for getting as close to the hardware as possible, because it is really a game programming library. Initially, you'd benefit because it's cross-platform and could allow you to test the vagaries of different OSs without re-writing your code. I recall hearing of one or two GUI toolkits that provide windows, buttons, sliders, and other widgets built on top of SDL (e.g. PyUI), but I haven't tried any of them.

Good luck.

Cheers!
Andrew


On Jan 19, 2005, at 7:42 AM, Steven Lacey wrote:

Hi,
 
I am new to both the Python progamming language and VisionEgg. I need to program an experiment and would like to know if VisionEgg can do what I need. The experiment is a study of how users interact with a GUI. It is at much higher level than the type of experiments done in psychophysics, which VisionEgg was designed to run (as I understand it). So, I have at least two problems to solve. First, I need to create the GUI and define the methods for interacting with the user. Ideally, I need methods for button responses to both mouse clicks and keypresses. It seems that this can be done in Python with either the Tkinter or wxPython module. Is that right? Moreover, it does not seem as if I can build a GUI using tools in VisionEgg itself? Is that right? My second problem is timing. As the user interacts with the GUI, I want to record with millisecond precision the time at which events occur. Would displaying the GUI with VisionEgg, if possible, enable the kind of temporal precision I require?
 
Thank you for any help you can provide,
Steve Lacey

Andrew D. Straw Post-doctoral scholar
,-. Dickinson Lab
\_/ California Institute of Technology
8||} Mailcode 138-78
/ \ Pasadena CA 91125, USA
`-^
email: astraw@xxxxxxxxxxx
office: +1 626 395 5828

Other related posts: