Image formula are string representation of classical equations composed of elementary items :
Usage of such a formula is classically associated to two stages :
For convenience, formula result types are restricted to two values types :
Image formula framework can be used with 2d or 3d images (see ipsdk::image::tools::eImageFormulaImageType). Some formula features will be customized depending on image type (image coordinates, structuring elements type, ...).
This section regroups information about used formula operators. Formula operators are described by ipsdk::image::tools::eImageFormulaOperatorType enumerate.
These operators allow all classical equation combinations such as :
or
This section describes formula functions available with IPSDK image formula framework.
Formula unary arithmetical functions are described by ipsdk::image::tools::eImageFormulaUnaryArithmeticFunctionType enumerate.
These functions allow introduction of unary arithmetic functions into equations such as :
or
Formula binary arithmetical functions are described by ipsdk::image::tools::eImageFormulaBinaryArithmeticFunctionType enumerate.
These functions allow introduction of binary arithmetic functions into equations such as :
or
Formula generic arithmetical functions are described by ipsdk::image::tools::eImageFormulaGenericArithmeticFunctionType enumerate.
These functions allow introduction of arithmetic functions using variable arguments list into equations such as :
or
These functions can be used with one or more operands.
Formula couple arithmetical functions are described by ipsdk::image::tools::eImageFormulaCoupledArithmeticFunctionType enumerate.
These functions allow introduction of arithmetic functions using coupled variable arguments list into equations such as :
or
Formula ternary logical functions are described by ipsdk::image::tools::eImageFormulaTernaryLogicFunctionType enumerate.
At this time a single function is available in this group :
or
or
Function evaluation returns :
Mapping functions are described by ipsdk::image::tools::eImageFormulaMapFunctionType enumerate.
At this time a single function is available in this group :
where is a logical predicate associated to a target value.
Function evaluation returns :
This section regroups information about used formula operands. Formula operands can be represented in following forms :
Formula static constant operands are described by ipsdk::image::tools::eImageFormulaStaticConstant enumerate. These constants will be replaced in equation by their numeric value :
will be replaced by its numerical value.
Formula dynamic constant operands are described by ipsdk::image::tools::eImageFormulaDynamicConstant enumerate. These constants will be replaced in equation by value extracted from used image informations.
These constants can be introduced into equations as follows :
Formula image constant operands are described by ipsdk::image::tools::eImageFormulaImageConstant enumerate. Each constant depends on an image id, see Formula variable operands. These constants will be replaced in equation by value extracted from used image informations.
These constants can be introduced into equations as follows :
Formula variable operands are associated image identifier (see ipsdk::image::tools::eFormulaImageId). These variable names can refer to :
Example :
In this case, we apply a mask operation which leads to where
pixels are set and to
otherwise.
Previous image variable operands can be used with combination of an offset value with format in 2d case and
in 3d case, where
,
and
represent an offset along
,
and
directions beside current image position.
In 2d case we can use a formula such as :
to compute a local "cross like" mean smoothing operation.
In 3d case this operation becomes :
to compute a local "cross like" mean smoothing operation.
As an extension of image offset combination capabilities, image formula allow usable of structuring elements. These features are described by ipsdk::image::tools::eImageFormulaStructuringElement enumerate.
A square structuring element such as :
will simply be replaced by its decomposition (in 2d case) :
This allows for example simple image smoothing operations (median filter with a circular structuring element in this case):
or morphological operations (erosion with a square structuring element in this case) :