Purpose

The module TypeArithmetic2 offers a large number of operations to calculate results from identical or different (non) scalar voxels from two input images.

Dependent on the selected operation the supported voxel types are vec2, vec2f, complexf, complexd, complexld, quaternionf, quaterniond, quaternionld, vec3-vec10, vec3f-vecf10, vec16, vecf16, vec32, vecf32, vec64, vecf64, mat2, matf2, mat3, matf3, mat4, matf4, mat5, matf5, mat6, matf6, Vector16, Vector and Vector64.

Details

  • Integer voxel components are converted to double voxel components before being used inside of the module, that means Vector16, Vector and Vector64 are converted to vec6 voxels before using them internally.
  • Internally all operations are calculated always either with float or double vector or matrix voxels. That means that other types such as the 2 component types vecf2, complexf, complexd, and complexld, are implicitly handled as type vec2 or vecf2, all 4 component types such as quaternionf, quaterniond, and quaternionld are implicitly handled as vec4 or vecf4, and all 6 component types such as vecf6, Vector16, Vector and Vector64 are implicitly handled as vec6 or vecf6.
  • If input voxel types are composed from both, float and double components, then the lower precision of both is used as component type for the output image. For example if a vecf3 voxel image is multiplied with a mat3 voxel image then the result voxel will be a vecf3. If the usage of double components shall be forced then the float component type must be cast appropriately to comparable double typed one.
  • If explicit operations on complex voxels are needed then the dedicated modules for complex arithmetic such as ComplexArithmetic1, ComplexArithmetic2, ComplexToReal or complex modules from ITK should be used instead of TypeArithmetic2.

Windows

Default Panel

../../../Modules/ML/MLTypeSupport/mhelp/Images/Screenshots/TypeArithmetic2._default.png

Input Fields

input0

name: input0, type: Image

input1

name: input1, type: Image

Output Fields

output0

name: output0, type: Image

Parameter Fields

Visible Fields

Operation

name: operation, type: Enum, default: Vec or Mat Plus Scalar To Vec or Mat

Defines the operation to calculate output voxels from input1 and input2 voxels.

Values:

Title Name Description
Vec or Mat Plus Scalar To Vec or Mat Vec or Mat Plus Scalar To Vec or Mat Scalar addition of any vector or matrix type and a scalar to a vector or matrix.
Vec or Mat Minus Scalar To Vec or Mat Vec or Mat Minus Scalar To Vec or Mat Scalar subtraction of any vector or matrix type and a scalar to a vector or matrix.
Vec or Mat Multiplied by Scalar To Vec or Mat Vec or Mat Multiplied by Scalar To Vec or Mat Scalar multiplication of any vector or matrix type and a scalar to a vector or matrix.
Vec or Mat Divided by Scalar To Vec or Mat Vec or Mat Divided by Scalar To Vec or Mat

Scalar division of any vector or matrix type and a scalar to a vector or matrix.

Divisions by zero will result to -DBL_MIN or DBL_MIN if negative or positive values are divide by zero, respectively.

Vec or Mat Component-wise Plus Vec or Mat To Vec or Mat Vec or Mat Component-wise Plus Vec or Mat To Vec or Mat Component-wise addition of vector or matrix and a vector or matrix to a vector or matrix.
Vec or Mat Component-wise Minus Vec or Mat To Vec or Mat Vec or Mat Component-wise Minus Vec or Mat To Vec or Mat Component-wise subtraction of vector or matrix and a vector or matrix to a vector or matrix.
Vec or Mat Component-wise Multiplied by Vec or Mat To Vec or Mat Vec or Mat Component-wise Multiplied by Vec or Mat To Vec or Mat Component-wise multiplication of vector or matrix and a vector or matrix to a vector or matrix.
Vec or Mat Component-wise Divided By Vec or Mat To Vec or Mat Vec or Mat Component-wise Divided By Vec or Mat To Vec or Mat

Component-wise division of vector or matrix and a vector or matrix to a vector or matrix.

Divisions by zero will result to -DBL_MIN or DBL_MIN if negative or positive values are divide by zero, respectively.

Mat x Mat To Mat Mat x Mat To Mat

Matrix multiplication of a mat and a mat to a mat.

Supported are mat[f] [2,3,4,5,6] x mat[f] [2,3,4,5,6].

Vec2 x Vec2 To Vec3 Vec2 x Vec2 To Vec3 Vector product of a vec[f]2 and a vec[f]2 (with 3rd comp = 0) to a vec3.
Vec3 x Vec3 To Vec3 Vec3 x Vec3 To Vec3 Vector product of a vec3 and a vec3 to a vec3.
Vec Dot Vec To Double Vec Dot Vec To Double Scalar product of a vector and a vector to a double.
Angle Between Vectors Angle Between Vectors Calculates the angle between two vectors.
Compute Maximum Vector Components Compute Maximum Vector Components Compare two vectors componentwise and give the maximum values into a new vector out
Compute Minimum Vector Components Compute Minimum Vector Components Compare two vectors componentwise and give the minimum values into a new vector out
Vec2 Dyadic Prod Vec2 To Mat2 Vec2 DyadicProd Vec2 To Mat2 Dyadic product of a vec[f]2 and a vec[f]2 to a mat2.
Vec3 Dyadic Prod Vec3 To Mat3 Vec3 DyadicProd Vec3 To Mat3 Dyadic product of a vec[f]3 and a vec[f]3 to a mat3.
Vec4 Dyadic Prod Vec4 To Mat4 Vec4 DyadicProd Vec4 To Mat4 Dyadic product of a vec[f]4 and a vec[f]4 to a mat4.
Vec5 Dyadic Prod Vec5 To Mat5 Vec5 DyadicProd Vec5 To Mat5 Dyadic product of a vec[f]5 and a vec[f]5 to a mat5.
Vec6 Dyadic Prod Vec6 To Mat6 Vec6 DyadicProd Vec6 To Mat6 Dyadic product of a vec[f]6 and a vec[f]6 to a mat6.
Vec x Mat To Vec Vec x Mat To Vec Multiplies a vec with a mat to a vec. Supported are vec[f] [2,3,4,5,6] x mat[f] [2,3,4,5,6].
Mat x Vec To Vec Mat x Vec To Vec Multiplies a mat with a vec to a vec. Supported are mat[f][2,3,4,5,6] x vec[f][2,3,4,5,6].
Vec4 x Mat4 To Vec3 Vec4 x Mat4 To Vec3 Multiplies a vec4 with a mat4, rescales it to 3D and writes it to a vec3.
Mat4 x Vec4 To Vec3 Mat4 x Vec4 To Vec3 Multiplies a mat4 with a vec4, rescales it to 3D and writes it to a vec3.
Affine Point3 x Mat4 To Vec3 AffinePoint3 x Mat4 To Vec3 Multiplies a affine 3D point with a mat4, rescales it to 3D and writes it to a vec3.
Mat4 x Affine Point3 To Vec3 Mat4 x AffinePoint3 To Vec3 Multiplies a mat4 with an affine vec3, rescales it to 3D and writes it to a vec3.
Affine Vector3 x Mat4 To Vec3 AffineVector3 x Mat4 To Vec3 Multiplies a affine 3D vector with a mat4, and writes it to a vec3.
Mat4 x Affine Vector3 To Vec3 Mat4 x AffineVector3 To Vec3 Multiplies a mat4 with an affine 3D vector, and writes it to a vec3.