Arithmetic2

MLModule
genre Binary
status stable
author Dirk Selle
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

Purpose

This module performs arithmetic operations on two images.

The output is the processed image according to the selected function and constant.

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.

Windows

Default Panel

../../../Modules/ML/MLBasicModules/mhelp/Images/Screenshots/Arithmetic2._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

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.
And And AND (IMG1 and IMG2) Apply a logical AND operation on the images. The AND operation is performed bitwise.
Xor Xor XOR (IMG1 xor IMG2) Apply a logical XOR operation on the images. The XOR operation is performed bitwise.
Difference Difference Difference (|IMG1-IMG2|)  
Mask Mask MaskIn (IMG2 ? C : IMG1) The ouput 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.
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   The output image will have the value Constant, if image 1 not equals image 2. Otherwise it will be zero.
Equal Mask EqualMask   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   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.

Constant

name: constant, type: Double, default: 0, deprecated name: C

Sets a constant value required for some arithmetic operations (see Function).

Auto Replicate

name: autoReplicate, type: Bool, default: FALSE