class to define a custom measure. More...
#include <ImageViz/Nodes/Measures/SoDataMeasureCustom.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoDataMeasureCustom () | |
Default constructor. | |
virtual const SbString & | getMeasureName () const |
Returns the name of this measure. | |
virtual UnitDimension | getUnitDimension () const |
Returns the "unit dimension" of the result data. Default is NOUNIT | |
virtual ResultFormat | getFormat () const |
Returns the "result format" of the result data. Default is FLOAT | |
Public Member Functions inherited from SoFieldContainer | |
void | setToDefaults () |
Sets all fields in this object to their default values. | |
SbBool | hasDefaultValues () const |
Returns TRUE if all of the object's fields have their default values. | |
SbBool | fieldsAreEqual (const SoFieldContainer *fc) const |
Returns TRUE if this object's fields are exactly equal to fc's fields. | |
void | copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE) |
Copies the contents of fc's fields into this object's fields. | |
SoNONUNICODE SbBool | set (const char *fieldDataString) |
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. | |
SbBool | set (const SbString &fieldDataString) |
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. | |
void | get (SbString &fieldDataString) |
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
virtual int | getFields (SoFieldList &list) const |
Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
virtual int | getAllFields (SoFieldList &list) const |
Returns a list of fields, including the eventIn's and eventOut's. | |
virtual SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (const SbName &fieldName) const |
Returns the eventOut with the given name. | |
SbBool | getFieldName (const SoField *field, SbName &fieldName) const |
Returns the name of the given field in the fieldName argument. | |
SbBool | enableNotify (SbBool flag) |
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE). | |
SbBool | isNotifyEnabled () const |
Notification is the process of telling interested objects that this object has changed. | |
virtual void | setUserData (void *data) |
Sets application data. | |
void * | getUserData (void) const |
Gets user application data. | |
Public Member Functions inherited from SoBase | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoDataMeasure | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoFieldContainer | |
static SoType | getClassTypeId () |
Returns the type of this class. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Public Attributes | |
SoSFString | measureName |
Measure name that can be used in custom measure combination formula. | |
SoSFString | formula |
Formula describing the custom measure. | |
Additional Inherited Members | |
Public Types inherited from SoDataMeasure | |
enum | UnitDimension { SQUAREINTENSITY , INTENSITY , VOLUME , AREA , PERIMETER , NOUNIT , DEGREES , PIXELS } |
"Unit dimension" is used to categorize the resulting unit of a measure. More... | |
enum | ResultFormat { INT , FLOAT , STRING , INT64 , UINT64 , DOUBLE } |
The "result format" is the type of the output of a measure computation. More... | |
class to define a custom measure.
A custom measure is defined by a string formula that can use other custom or predefined measure. It must have a unique name.
Remarks :
The following syntax can be used to define a formula :
() : 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
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
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.
SoDataMeasurePredefined, SoLabelAnalysisQuantification, SoFilterAnalysisQuantification, SoGlobalAnalysisQuantification, SoFilterByMeasureProcessing, SoSieveLabelingProcessing, SoAdaptiveThresholdingProcessing
Definition at line 194 of file SoDataMeasureCustom.h.
SoDataMeasureCustom::SoDataMeasureCustom | ( | ) |
Default constructor.
|
static |
Returns the type identifier for this class.
|
virtual |
Returns the "result format" of the result data. Default is FLOAT
Default is FLOAT
Implements SoDataMeasure.
|
inlinevirtual |
Returns the name of this measure.
This name can be then used in custom measure formula
Implements SoDataMeasure.
Definition at line 208 of file SoDataMeasureCustom.h.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoDataMeasure.
|
virtual |
Returns the "unit dimension" of the result data. Default is NOUNIT
Default is NOUNIT
Implements SoDataMeasure.
SoSFString SoDataMeasureCustom::formula |
Formula describing the custom measure.
Definition at line 205 of file SoDataMeasureCustom.h.
SoSFString SoDataMeasureCustom::measureName |
Measure name that can be used in custom measure combination formula.
Definition at line 202 of file SoDataMeasureCustom.h.