![]() |
Opticka 2.18.1
Opticka is an experiment manager for behavioral research.
|
Customised user functions for a task run. More...
Customised user functions for a task run.
The state machine's job is to run a set of functions when entering and exiting states. Most required functions (methods in classes) are found in the core opticka classes like screenManager, stateMachine etc. BUT if a user wants to customise their own functions then we need to have a generic class we can load and use where you can add your own methods. This class serves this purpose.
The user should subclass it (or you can make a copy keeping name the same) and add functions there and then save it as a new class somewhere alongside their protocols (if you copy this you can rename the file, but keep the class name the same; if you subclass it then the file and class name should be the same). The user can add their own methods. The class will be added as a uF object and these methods can be used via the state info file, like:
@()myCustomFunction(uF)
IMPORTANT: as these are stored as anonymous function handles in the state machine, any variables passed are set at instantiation time, not at run-time. If you need to get a run-time (changing) variable, make a function. So if you need to get a value X that changes as the experiment runs, make a function like X = getCurrentX() that returns the current value. Now when the state machine calls the function the correct value is returned.
Copyright ©2014-2026 Ian Max Andolina — released: LGPL3, see LICENCE.md
Public Member Functions | |
| virtual | initialSetup (in me) |
| function | userFunctions () |
| function | setDelayTimeWithStaircase (in me, in stim, in duration) |
| Construct an instance of this class. | |
| function | resetDelayTime (in me, in stim, in value) |
| Use the staircase to set stimulus delay/off time. | |
| function | testFunction (in me) |
| Reset stimulus delay time to a specific value. | |
Public Attributes | |
| Property | rE |
| runExperiment | |
| Property | sM |
| stateMachine | |
| Property | s |
| screenManager | |
| Property | task |
| taskSequence | |
| Property | stims |
| metaStimulus stimluli | |
| Property | rM |
| reward manager | |
| Property | io |
| I/O manager. | |
| Property | eT |
| eyetracker manager | |
| Property | tM |
| touch manager | |
| Property | tL |
| time logger (saves timestamped messages | |
| Property | alyx |
| alyx manager | |
| Property | verbose |
| toggle to send messages to the command window | |
| function userFunctions::userFunctions | ( | ) |
|
virtual |
initial setup to run BEFORE the task starts; this will be called by runExperiment before the state machine starts, and before the first runExperiment.update(stims) call, so you can set up any variables or stimuli here that you want to use in the task. You can also call other functions from here to set things up.
Reimplemented in DMTSFunctions, and myUserFunctions.
| function userFunctions::resetDelayTime | ( | in | me, |
| in | stim, | ||
| in | value | ||
| ) |
Use the staircase to set stimulus delay/off time.
| stim | Index of stimulus in stims. |
| duration | Optional extra duration added to off time. |
| function userFunctions::setDelayTimeWithStaircase | ( | in | me, |
| in | stim, | ||
| in | duration | ||
| ) |
Construct an instance of this class.
| function userFunctions::testFunction | ( | in | me | ) |
Reset stimulus delay time to a specific value.
| stim | Index of stimulus in stims. |
| value | Delay time value to apply. |
| Property userFunctions::alyx |
alyx manager
| Property userFunctions::eT |
eyetracker manager
| Property userFunctions::io |
I/O manager.
| Property userFunctions::rE |
| Property userFunctions::rM |
reward manager
| Property userFunctions::s |
| Property userFunctions::sM |
| Property userFunctions::stims |
metaStimulus stimluli
| Property userFunctions::task |
| Property userFunctions::tL |
time logger (saves timestamped messages
| Property userFunctions::tM |
touch manager
| Property userFunctions::verbose |
toggle to send messages to the command window