Individual Measurements
Analysis algorithms applying a measurement on each label of the input image.
- VolumeFractionByLabel: Computes the volume fraction occupied by each object or region of a segmented image.
- LabelCountByRegion: Computes, for each region of a first label image, the number of objects contained in a second label image.
- VolumeFractionByRegion: Computes, for each region of a first label image, the intersection ratio with particles of a second label image.
- LabelAnalysis: Computes a set of measurements on objects defined in a label image.
- LabelFiltering: Removes objects from a label image based on measurement criteria.
- LabelFilteringAnalysis: Computes measurements on objects and filters them from a label image.
- FilterAnalysis: Filters objects from an analysis object.
- MeasurementToImage: Replaces all labels of the input image by the result of an individual measurement.
- FilterByMeasurement: Preserves a predefined number of objects according to a selected measurement.
For an introduction: Image Analysis
Most of these algorithms have a field to set one or several input measurements.
The following algorithms filter an image with a criterion defined in a formula:
For example, to define a filter preserving particles having a diameter lower than 50, in the coordinate system defined by the image calibration, in C#:
Formula can be composed of constants, operators, functions, and variables (native measurements and custom measurements).
Remarks:
Most of these algorithms have a field to set one or several input measurements.
Filtering objects in an image
The object filtering algorithms remove or preserve shapes from a binary or label image according to measurement criteria.The following algorithms filter an image with a criterion defined in a formula:
For example, to define a filter preserving particles having a diameter lower than 50, in the coordinate system defined by the image calibration, in C#:
labelFilter.inputFilter = NativeMeasurements.EqDiameter.name + "< 50"
Custom Formula syntax
A custom formula syntax is checked by several ImageDev algorithms:- ImageFormula
- Individual analysis with custom measurements
- Object filtering algorithms
Formula can be composed of constants, operators, functions, and variables (native measurements and custom measurements).
Remarks:
- The following (unless specified) constants, operators, functions, and variables are case-insensitive and can be used both with custom measurements and custom filters.
- The following (unless specified) operators and functions are insensitive to spaces. Constants and variables must not be directly attached to alpha numerical symbols.
Basic operators
- (): brackets allow you to group elements and to modify operator precedence
example: (2 + 3)*4 - +: unary arithmetic operator [plus]
example: + a - -: unary arithmetic operator [minus]
example: - b - +: binary arithmetic operator [plus]
example: a + b - -: binary arithmetic operator [minus]
example: a - b - *: binary arithmetic operator [multiply]
example: a * b - /: binary arithmetic operator [divide]
example: a / b
remark: a division by 0 returns the value 0 in order to avoid exceptions. - **: binary arithmetic operator [power]
example: a ** b - !: unary logical operator [not]
example: !(a> b) - && or And: binary logical operator [and]
example: (a > b) && (a < c)
example: (a > c) And (a < c)
remark: And operator must not be directly attached to alpha numerical symbols. - || or Or: binary logical operator [or]
example: (a > b) || (a < c)
example: (a > b) Or (a < c)
remark: Or operator must not be directly attached to alpha numerical symbols. - ==: comparison operator (logical and arithmetic) [equal]
example: a==b
example: true==true - !=: comparison operator (logical and arithmetic) [different]
example: a != b
example: true != false - <: arithmetic comparison operator [strictly inferior]
example: a < b - <=: arithmetic comparison operator [less]
example: a<= b - >: arithmetic comparison operator [strictly superior]
example: a > b - >=: arithmetic comparison operator [superior]
example: a >= b
Constant values
- Pi: $\pi$, the pi constant
example: 3 * Pi - E: the Euler's constant
example: 2 * E - True: the true boolean value
example: (3< Pi)==True - False: the false boolean value
example: (3> Pi)==False - NbFeret: distribution size for Feret measurements
example: 3*NbFeret - gx, gy and gz: image X, Y, and Z dimensions
example: 3*gx
remark: not available for custom filters - cx, cy and cz: pixel real size according to calibration
example: 3*cx
remark: not available for custom filters
Functions
- Abs: absolute value of a numerical value
example: Abs(a) - Sqrt: square root value of a numerical value
example: Sqrt(a)
remark: a must be positive or null - Exp: exponential value of a numerical value
example: Exp(a) - Log: natural logarithm value of a numerical value
example: Log(a)
remark: a must be strictly positive - Cos: cosine value of a numerical value
example: Cos(a) - Sin: sine value of a numerical value
example: Sin(a) - Tan: tangent value of a numerical value
example: Tan(a) - ACos: arccosine value of a numerical value
example: ACos(a)
remark: a must be within the range [-1, 1] - ASin: sine arcvalue of a numerical value
example: ASin(a)
remark: a must be within the range [-1, 1] - ATan: arctangent value of a numerical value
example: ATan(a) - ATan2: arctangent value of a 2d point
example: ATan2(y, x) - CosH: hyperbolic cosine value of a numerical value
example: CosH(a) - SinH: hyperbolic sine value of a numerical value
example: SinH(a) - TanH: hyperbolic tangent value of a numerical value
example: TanH(a) - Min: retrieve minimum value of a variable sized set of numerical values
example: Min(a, b, c, d) - Max: retrieve maximum value of a variable sized set of numerical values
example: Max(a, b, c, d, e) - Avg: retrieve mean value of a variable sized set of numerical values
example: Avg(a, b, c) - Median: retrieve median value of a variable sized set of numerical values
example: Median(a, b, c, d) - Sum: compute the sum of a variable sized set of numerical values
example: Sum(a, b, c) - Product: compute the product of a variable sized set of numerical values
example: Product(a, b, c, d, e) - If: conditional evaluation of an expression
example: If(predicat, value_true, value_false)
remark: Each member of a conditional expression is systematically evaluated even if it is not supposed to be reached by the condition. Thus, an instruction can raise an error even if the condition is supposed to prevent invalid evaluations.
example: If(I1< =0, 0, log(I1)) will raise an error if a voxel value is lower or equal to 0 since the log expression will be evaluated before the if statement.