klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
5 stars 3 forks source link

Restore diode with iti #157

Closed bartkrekelberg closed 3 years ago

bartkrekelberg commented 3 years ago

Following up on issue Diode #145.

I restored the old way of handling diode flasher inside the stimulus class, to reduce overhead and avoid the nasty interference with itiClear that was needed before.

To make this work I created a beforeItiFrame functionality (in the baseBeforeItiFrame the diode flasher is turned on or off as needed). Not sure that any other plugin would need a beforeItiFrame, but now they can define it.

The calls to add a diodeFlasher to a stimulus is simplified to

addDiodeFlasher(stimulus) and the old options can be set in this function call too (location, size, onColor, offColor)

Updated tools and added demo to behaviorDemo

cnuahs commented 3 years ago

This works for me. Tested on my MacBook today but I have high confidence it will work on the rigs also.