[visionegg] Re: mouse and time logging o.k. please see through the code
- From: Andrew Straw <andrew.straw@xxxxxxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Fri, 13 Dec 2002 16:41:42 -0700
Hi Christoph,
Your code looks fine. I don't think the amount of processing you're doing on every frame is anything to worry about. Your image_selector() function gets called every frame, but it really doesn't contain very much -- certainly not as much as what the go() loop itself evaluates on each frame. Still, you could trim it down a bit by removing your calls to VisionEgg.timing_func(): the variable t that gets passed in is already this information (in seconds since the onset of go). However, I wouldn't worry about execution speed unless you start doing a LOT more calculations or something that potentially takes a long time for other reasons.
Stimulus timing issues and stimulus display on triggers from the parallel port: modify the image_selector() function to do what you want. Polling LPT from within that loop should work fine. A call to the inp() function will last longer than function calls to trivial functions because it actually queries the hardware. IIRC, polling LPT involves waiting for an ISA bus tick, which happens every microsecond, so it shouldn't make a noticeable difference. From the email I wrote 26 Nov:
I just had a look through the parallel port code to refresh my memory, and the simplest way to read the parallel port will be something like:
from VisionEgg.DaqLPT import raw_lpt_module
input_value = raw_lpt_module.inp(0x379)
output_value = 0xFF
raw_lpt_module.out(0x378, output_value)
Fixation spot: Check out any demo with a fixation spot for how to create one.
You could control its presence through altering when it is included in the stimulus list returned from the image_selector() function (make sure it's last in the list so it gets drawn over anything else). In that case, it would be more accurate to call this function "get_active_stimulus_list()" or something.
Another idea is to replace image_selector() with a something like "frame_by_frame_callback()" and register it with "p.add_controller(None,None,..", which gets it called at appropriate times but doesn't care about the return value. In that case, it would do its work by explicitly setting any parameters you want, such as viewport.parameters.stimuli and maybe fixation_spot.parameters.on
Cheers!
Andrew
- References:
- [visionegg] mouse and time logging o.k. please see through the code
- From: Christoph Lehmann
Other related posts:
- » [visionegg] mouse and time logging o.k. please see through the code
- » [visionegg] Re: mouse and time logging o.k. please see through the code
from VisionEgg.DaqLPT import raw_lpt_module
input_value = raw_lpt_module.inp(0x379)
output_value = 0xFF
raw_lpt_module.out(0x378, output_value)
- [visionegg] mouse and time logging o.k. please see through the code
- From: Christoph Lehmann