klabhub / neurostim

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

strategy to achieve consistent diodeFlasher #211

Open dshimaoka opened 1 year ago

dshimaoka commented 1 year ago

There is a demand diodeFlasher to behave in the same way in a given rig. Ideally the diodeFlasher behavior is set once in a rig-specific config file, and not in individual stimulus scripts. One way to achieve this involves a modification of estim, together with the following lines of code in the rig-specific config file as:

e = neurostim.stimuli.estim(c,'estim');
e.mccCntr = 0;
e.enabled = 0;
e.on = 0;
e.duration = Inf;
e.addDiodeFlasher;

Is this robust enough to be incorporated into the master branch? Or should we develop another strategy?

bartkrekelberg commented 1 year ago

estim only works in a rig that uses both intan and MCC. That is a very specific combination of hardware.

I think it would be better to integrate the stimulation functionality with the Intan plugin. (Because there is virtually no generic stimulation functionality in eStim).

Along similar lines, if you're looking to always have the same diodeFlasher with Intan recordings, you could add the diodeFlasher as an optional addition to the Intan plugin code? Maybe that would give you the desired consistency across experiments (even those that do not use stimulation).

One catch would be that a user may try to add a second diode flasher to a different plugin in their experiment file. I am not sure how the code (or the actual diode) would deal with that... A warning ('a diodeFlasher has already been added to this experiment' ) may then be appropriate.