USER FUNCTIONS Dialog
ScanImage often requires customization for end user needs, e.g. to coordinate imaging with stimulus, to perform on-line analysis, etc. This often can be accomplished by binding User Functions (M files written for the end user needs) to one or more ScanImage events.
See User Functions & Plugins for more background. All user functions should follow the required User Function signature.
Main Section
: List of events to which user functions (event listeners) can be bound. These are pre-defined by ScanImage, but custom events can be readily added, if required, as discussed below.
: Name of user-specified function to execute when event occurs. Generally these are specified by
, but they can also be entered directly if the user function is a Matlab built-in function.
: User functions can take optional arguments, specified here. This allows behavior of function to be modulated. See User Function signature. A single value can be entered if only one argument is expected. If more than one argument is required, it should be entered as a cell array, e.g. {<Arg1Value> <Arg2Value> ...}.
: Checkbox enables/disables execution of specified user function for particular event.
: Up to 10 user functions can be bound to each listener. There are thus effectively 10 tables of event/user function configuration. This value adjusts which of these is currently displayed and available for editing.
: Enables or disables all of the user functions specified for events with user function specified, at current
.
The /
operations act on the currently selected event. To select event, the mouse/cursor should be placed in one of the editable controls for given event.
: Launches file browser dialog allowing selection of user function for currently selected event (and current
). The file selected need not be on the Matlab search path.
: Removes user function, if any, bound to currently selected event (at current
.
&
: User functions bindings can be stored/loaded to/from either the ScanImage Configuration or User Settings. The
&
buttons (only one can be active) determine which of these sets of bindings are shown and edited in the table.
: Saves currently displayed user function bindings to either Configuration or User Settings, according to whether
or
is currently enabled.
USR-only
Two special events – appOpen and appClose – pertain to the start and close of ScanImage. Any function bindings to these events can only sensibly be saved to ScanImage User Settings files. They are shown in their own table.
Override User Functions
Override User Functions are a special type of user function, which completely replaces a ScanImage file. Four functions can presently be overridden:
- makeStripe: Per-frame processing function for FOCUS acquisitions
- makeFrameByStripes: Per-frame processing function for GRAB/LOOP acquisitions
- endAcquisition: Function invoked at end of GRAB acquisitions and LOOP Repeats
- makeMirrorDataOutput: Function which generates buffered waveforms to be output to mirror control signals
Override user function bindings are stored as part of the ScanImage Configuration. In this way, the native ScanImage behavior can be maintained generally while being overridden for particular configuration(s) with the binding specified.