Click or drag to resize
SoDataMeasureCustom Class

class to define a custom measure.

Inheritance Hierarchy

Namespace: OIV.ImageViz.Nodes.Measures
Assembly: OIV.ImageViz (in OIV.ImageViz.dll) Version: 2023.1.3.0 (2023.1.3)
Syntax
public class SoDataMeasureCustom : SoDataMeasure

The SoDataMeasureCustom type exposes the following members.

Constructors
  NameDescription
Public methodSoDataMeasureCustom

Default constructor.

Top
Methods
  NameDescription
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetFormat

Returns the "result format" of the result data.

(Inherited from SoDataMeasure.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMeasureName

Returns the name of this measure.

(Inherited from SoDataMeasure.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUnitDimension

Returns the "unit dimension" of the result data.

(Inherited from SoDataMeasure.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoBase.)
Top
Properties
  NameDescription
Public propertyformula

Formula describing the custom measure.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertymeasureName

Measure name that can be used in custom measure combination formula.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

A custom measure is defined by a string OIV.ImageViz.Nodes.Measures.SoDataMeasureCustom.formula that can use other custom or predefined measure. It must have a unique name.

SoDataMeasureCustom* myMeasure1 = new SoDataMeasureCustom();
myMeasure1->measureName = "myMeasure1";
myMeasure1->formula = SoDataMeasurePredefined.getName(SoDataMeasurePredefined.VOLUME) + "/" + SoDataMeasurePredefined.getName(SoDataMeasurePredefined.AREA);

SoDataMeasureCustom* myMeasure2 = new SoDataMeasureCustom();
myMeasure2->measureName = "myMeasure2";
myMeasure2->formula = myMeasure1.getMeasureName() + "*2";

Custom formula syntax

Custom formula syntax is checked before acceptation by ImageViz. Custom measure formula and custom filter formula follow the same basic rules and can use the same set of predefined functions. Custom measure formula must be a numerical value whereas custom filter formula must be a logical value to be accepted. Formula can be composed of constants, operators, functions and variables (native measures and custom measures).

Remarks :

  • The following (unless specified) constants, operators, functions and variables are unsensitive to case and can be used both with custom measures and custom filters.

  • The following (unless specified) operators and functions are unsensitive to spaces. Constants and variables must not be directely attached to alpha numerical symbols.

The following syntax can be used to define a formula :

Basic operators

() : brackets allowing to group elements and to modify operators 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 [pow] 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 directely 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 directely 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 : , 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 measures example : 3*NbFeret

gx : , gy : and gz : image X, Y and Z size associated to measure example : 3*gx remark : not available for custom filters

cx : , cy : and cz : stand for 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 within range [-1, 1]

ASin : sine arcvalue of a numerical value example : asin(a) remark : a must within range [-1, 1]

ATan : arctangent value of a numerical value example : atan(a)

ATan2 : arctangent value of a 2d point example : atan(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)

Sum : 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.

See Also