ImageDev

Syntax Check

This section introduces how to check the syntax of command parameters.

Custom Formula syntax

A custom formula syntax is checked by several ImageDev algorithms: The custom measurement formulae and the custom filter formulae follow the same basic rules and can use the same set of predefined functions. The solution of a custom measurement formula must be a numerical value, whereas for a custom filter formula it must be a logical value to be accepted.
Formulae can be composed of constants, operators, functions, and variables (native measurements and custom measurements).

Remarks: The following syntax can be used to define a formula:

Basic operators

Constant values

Functions

Syntax

Method Description
bool checkFilterFormula( const std::string& formula ) Checks if a filter selecting labels from analysis measurements criteria is valid.
Returns true if the formula is valid, returns false otherwise.
bool checkImageFormula( const std::string& formula ) Checks if a formula to be used by the ImageFormula algorithm is valid.
Returns true if the formula is valid, returns false otherwise.
bool checkMeasurementFormula( const std::string& formula ) Checks if the defining a new custom measurement is valid.
Returns true if the formula is valid, returns false otherwise.
Method Description
check_filter_formula(formula) Checks if a filter selecting labels from analysis measurements criteria is valid.
Returns true if the formula is valid, returns false otherwise.
check_image_formula(formula) Checks if a formula to be used by the ImageFormula algorithm is valid.
Returns true if the formula is valid, returns false otherwise.
check_measurement_formula(formula) Checks if the defining a new custom measurement is valid.
Returns true if the formula is valid, returns false otherwise.
Method Description
public bool CheckFilterFormula(string formula) Checks if a filter selecting labels from analysis measurements criteria is valid.
Returns true if the formula is valid, returns false otherwise.
public bool CheckImageFormula(string formula) Checks if a formula to be used by the ImageFormula algorithm is valid.
Returns true if the formula is valid, returns false otherwise.
public bool CheckMeasurementFormula(string formula) Checks if the defining a new custom measurement is valid.
Returns true if the formula is valid, returns false otherwise.