The calculator filter uses the VTK filter vtkArrayCalculator. The calculator filter can be used to create new data arrays by performing operations on current data arrays. The user interface for the Calculator filter is similar to that of a desktop calculator. After selecting an active data object, the user can specify a mathematical equation to be applied to the specified data arrays.
- First the user selects the data they wish to operate on from the Selection Window. It will be highlighted when this occurs.
- The user can then select Filter->Alphabetical->Calculator Attributes from the main menu or click on the button. This will open the Calculator interface.
- Enter the mathematical equation into the calculator interface.
- The Accept button must be pressed before the output will be generated.
A brief description of the functions and symbols understood by the Array Calculator:
|iHat||I Unit Vector|
|jHat||J Unit Vector|
|kHat||K Unit Vector|
|abs||Absolute Value of a Scalar|
|ceil||"Ceiling", round a floating-point number up to an integer|
|cross(x,y)||Returns the Cross Product of the two vectors X & Y|
|floor||Round a floating-point number down to an integer|
|mag||Magnitude of a vector|
|min(x,y)||Return the minimum of two scalars|
|max(x,y)||Return the maximum of two scalars|
|norm||Normalize a Vector, dividing it by the magnitude|
|sign||Returns -1 if the scalar is negative, +1 if the scalar is positive, and 0 if the scalar is 0|
|x.y||Dot Product of x and y|
|x^y||x raised to the y power|
|e^y||e (2.71828183, Euler's Number) raised to the y power|
Some typical formulae:
- Combining three scalars into a vector field: (iHat*Scalar1)+(jHat*Scalar2)+(kHat*Scalar3)
- Computing a vector magnitude: mag(Vector)