User-defined parameters
Top  Previous  Next

ImageWarp scripting language can be used to define custom measurements in form of user-defined parameters. The following functions provide support for custom parameters: measObjects, measFields, measBlobs,measContours, measCurves,

User-defined parameters are submitted to measurement functions via the optional last argument in the argument list. This argument must be a string that contains the code defining a procedure for calculating custom parameters and written in ImageWarp language standard. An escape sequence \n must be used to indicate line breaks in the code. Before being used in a measurement function, the user-defined parameters should be activated with
selectParam with one of the following arguments: "User1", "User2", "User3", "User4", "User5". As an alternative, you can assign your own name for a user-defined parameter by calling renameParam and use the new name for selecting and defining the parameter.

The following example shows how to define custom parameters and use them in measurements.


'assign custom name for user-defined parameter User1  
'defining a formula:  
'set the scope of interactive functions to global parameter list  
'select parameters for measurements including the newly defined one  
'Submit definition string as a last argument for measurement function