Icon

This documentation is for a legacy ScanImage version. The current documentation is ScanImage 2019.

Skip to end of metadata
Go to start of metadata

USER FUNCTIONS Panel

Description

Assign user-defined functions that will be called in response to acquisition events.

Controls

Table FieldDescription
Event NameSelect one of several events of interest.
User FunctionThe function to call in response to the event. Note that multiple events can be sent to the same function.
ArgumentsA cell array with optional arguments to pass to your user function.
EnableIf this is checked, the user function will be called when the event is triggered.
ButtonDescription
Add or delete a user function. Delete operates on the currently selected row.
User functions can be stored in the CFG file or the USR file. Typically USR-defined user functions override those in CFG. The main table view is toggled to show either the CFG or USR set based on these buttons.
Saves the current set of user functions to the CFG or USR configuration.

Click this button to view both the set of CFG and USR configured user-functions at the same time.

 

 

 

User Functions

A user function has the format:

ArgumentDescription
sourceAt the moment, this is always the current instance of scanimage.SI5 class. Also known as hSI on the base Matlab workspace.
eventA string with the name of the event that triggered the user function.
argumentsA cell array with optional parameters. Specified in the arguments column of the User Functions table.
A Very Very Brief Example

 

Events

EventDescription
acqModeStart
Called just before the start of an Acquisition Mode such as GRAB or LOOP. This may happen before any data is acquired.
acqModeDone
Called just after the last frame at the end of an Acquisition Mode such as GRAB or LOOP.
acqStart
Called just after the first frame gets acquired from an Acquisition.
acqDone
Called just after the last frame gets acquired from an Acquisition.
acqAbort
Called just after an acquisition is aborted. Abort usually happens because the Abort button is pressed in the Main Controls.
sliceDone
Called just after the shutter is closed after acquiring a slice during a Slow Stack acquisition.
focusStart
Called just after the user presses the FOCUS button in the Main Controls.
focusDone

Called just after the FOCUS is aborted. Similar to acqAbort but only in FOCUS mode.

frameAcquired
Called just after a frame is acquired.
overvoltage
Called when the digitizer experiences an overvoltage condition during an acquisition.