Arithmetic2¶
-
MLModule
¶ genre Binary
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLBasicModules
definition mlBasicModules.def see also Arithmetic1
,Mask
,SoCalculator
keywords add
,multiply
,subtract
,difference
,divide
,min
,max
,or
,and
,xor
,mask
,equal
,eq
,neq
,operation
,images
Purpose¶
This module performs arithmetic operations on two images.
The output is the processed image according to the selected function and constant.
This module only supports scalar types for most functions. The functions Add, Multiply, Subtract, Equal, NotEqual, EqualMask, NotEqualMask and MaskConstantIn also support the default extended types: Complex, Vector2, Vector3, Vector6, Matrix2 and Matrix3.
Usage¶
Select the arithmetic operation you want to apply to the two input images. Some operations (see below) require the specification of a further constant.
Tips¶
The example network demonstrates how two images can be added by the Arithmetic2 operator.
Parameter Fields¶
Visible Fields¶
Function¶
-
name:
function
, type:
Enum
, default:
Add
, deprecated name:
Function
¶ Defines the operation which is applied to the two input images.
Values:
Title | Name | Deprecated Name | Description |
---|---|---|---|
Add | Add | Add (IMG1+IMG2) | The input image 1 increased by input image 2 is passed to the output. |
Multiply | Multiply | Multiply (IMG1*IMG2) | The input image 1 multiplied by input image 2 is passed to the output. |
Subtract | Subtract | Subtract (IMG1-IMG2) | The input image 1 decreased by input image 2 is passed to the output. |
Divide | Divide | Divide (IMG1/IMG2) | The input image 1 divided by input image 2 is passed to the output. |
Max | Max | Max (IMG1, IMG2) | The maximum value of input images 1 and 2 is passed to the output. |
Min | Min | Min (IMG1, IMG2) | The minimum value of input images 1 and 2 is passed to the output. |
Abs Max | AbsMax | The value of input images 1 and 2, which is the maximum absolute value, is passed to the output. | |
Abs Min | AbsMin | The value of input images 1 and 2, which is the minimum absolute value, is passed to the output. | |
Or | Or | OR (IMG1 or IMG2) | Apply a logical OR operation on the images. The OR operation is performed bitwise. This is an integer operation, so that floating points will be calculated as integer. |
And | And | AND (IMG1 and IMG2) | Apply a logical AND operation on the images. The AND operation is performed bitwise. This is an integer operation, so that floating points will be calculated as integer. |
Xor | Xor | XOR (IMG1 xor IMG2) | Apply a logical XOR operation on the images. The XOR operation is performed bitwise. This is an integer operation, so that floating points will be calculated as integer. |
Difference | Difference | Difference (|IMG1-IMG2|) | The absolute difference between input image 1 and 2 is passed to the output. |
Equal | Equal | EQ (i1 == i2 ? C : 0) | The output image will have the value Constant, if image 1 equals image 2. Otherwise it will be zero. |
Not Equal | NotEqual | NEQ (i1 != i2 ? C : 0) | The output image will have the value Constant, if image 1 not equals image 2. Otherwise it will be zero. |
Equal Mask | EqualMask | EQ2 ((i1 && i2 && i1==i2) ? C : 0) | The output image will have the value Constant, if image 1 equals image 2 and both images are not zero. Otherwise it will be zero. |
Not Equal Mask | NotEqualMask | NEQ2 ((i1 && i2 && i1!=i2 ) ? C : 0) | The output image will have the value Constant, if image 1 not equals image 2 and both images are not zero. Otherwise it will be zero. |
Mask Constant In | MaskConstantIn | MaskIn (IMG2 ? C : IMG1),Mask | The output image data will be copied from image 1 where image 2 is zero. Where image 2 is non-zero, the value Constant will be written. This can be used to perform a “mask in” operation writing a different value than the one in the original mask and can be useful when both images have different data types. |
Output Image Size¶
-
name:
outputImageSize
, type:
Enum
, default:
InvalidateOutputIfSizesDiffer
¶ Defines how the module should react if the image sizes of the input images differ.
Values:
Title | Name | Description |
---|---|---|
Adapt Output Image Size | AdaptOutputImageSize | The module adapts the output image size to the input image sizes. If the field |
Invalidate Output If Sizes Differ | InvalidateOutputIfSizesDiffer | If the input image sizes differ, the output image is invalidated. |