Purpose

The module BitImageArithmetic provides arithmetic operations on one or on two input bit images which then produce an output ml.BitImage. When setting the appropriate update modes it can also be used for caching a BitImage similar to the MemCache or the MLImageFormatFileCache modules.

Usage

Connect one or two base ml.BitImage objects to the input Base connectors; if one BitImage is connected (to first input) then the Unary Operations provides the arithmetic operations which can be used to calculate the output BitImage; if two BitImages are connected then the Binary Operations selector determines which operation is applied to the two input images. If no or only the second input is valid then the output image is invalidated.

Windows

Default Panel

../../../Modules/ML/MLBitImageTools/mhelp/Images/Screenshots/BitImageArithmetic._default.png

Input Fields

The first or the first and the second input must be connected and contain a BitImage, otherwise no output image will be calculated.

inputBitImage0

name: inputBitImage0, type: BitImage(MLBase)

Needs to be a BitImage.

inputBitImage1

name: inputBitImage1, type: BitImage(MLBase)

Optional input. If not connected, only unary operations are available.

Output Fields

outputBitImage

name: outputBitImage, type: BitImage(MLBase)

The output contains a BitImage base object if a valid operation is applied to the first or to both input images. Other connected Base objects or non updated parameter settings etc. or using the Reset mode in Unary Operations will lead to an invalidated output image.

Parameter Fields

Field Index

Apply: Trigger
Apply Mode: Enum
Binary Operations: Enum
binaryIsActive: Bool
Box Corner 1: IntVector6
Box Corner 2: IntVector6
Unary Operations: Enum
Update Mode: Enum

Visible Fields

Unary Operations

name: unaryOperations, type: Enum, default: CopyInput

Defines the operation on first input image to calculate the output image.

Values:

Title Name Description
Copy Input CopyInput The output image is a copy of the input image.
Negate Negate The entire input image is copied to the output and inverted.
Reset Reset Makes output image empty but valid.
Sub Image SubImage

Cuts out a region given by (Box Corner 1, Box Corner 2) and copies it to the output.

Only regions are considered valid where all components of Box Corner 2 are greater or equal then the corresponding components of Box Corner 1. All other region specifications are considered empty and the output image will be invalidated.

Note that region specifications reaching outside the image will be clamped to the valid image region.

Clear Clear The output image is set to the extent of the input image and all pixels will be cleared.
Set Set The output image is set to the extent of the input image and all pixels will be set.
Bounded Object BoundedObject

This mode determines the bounding box of all set pixels in the first input image and copies that region to the output image.

If no set pixels are found then the output will be invalidated. The fields Box Corner 1 and Box Corner 2 will be set to the corners of the determined bounding box.

Binary Operations

name: binaryOperations, type: Enum, default: And

Defines the operation on both input image to calculate the output image.

Values:

Title Name Description
And And Result image is a pixel-wise Boolean and operation of the two input images.
Or Or Result image is a pixel-wise Boolean or operation of the two input images.
Xor Xor Result image is a pixel-wise Boolean xor operation of the two input images.
Copy Input0 CopyInput0 Result image is a copy of inputBitImage0.
Copy Input1 CopyInput1 Result image is a copy of inputBitImage1.
Copy Sub Image Set CopySubImageSet

Copies second input to output and copies the region (Box Corner 1, Box Corner 2) to the output. Only regions are considered valid (i.e. non empty) where all components of v2 are greater or equal then the corresponding components of v1. All other region specifications are considered empty and will have no effect to the output image.

Note that region specifications reaching outside any image will be clamped to valid image regions.

Copy Sub Image Clear CopySubImageClear Like CopySubImageSet but all set voxels from the input region are cleared in the output image.
Copy Sub Image And CopySubImageAnd Like CopySubImageSet but all set voxels from the input region are anded to the output image.
Copy Sub Image Or CopySubImageOr Like CopySubImageSet but all set voxels from the input region are ored to the output image.
Copy Sub Image Xor CopySubImageXor Like CopySubImageSet but all set voxels from the input region are xored to the output image.

Box Corner 1

name: v1, type: IntVector6, default: 0 0 0 0 0 0

Sets the first corner of the box defining a subimage region.

Box Corner 2

name: v2, type: IntVector6, default: 0 0 0 0 0 0

Sets the second corner of the box defining a subimage region.

Apply Mode

name: applyMode, type: Enum, default: AutoApply

Defines what to do on parameter changes.

Values:

Title Name Description
Off Off Do nothing on parameter changes.
Auto Apply AutoApply Update output automatically on parameter changes.
Auto Clear AutoClear Invalidates (cached) BitImage at output on any parameter change.

Update Mode

name: updateMode, type: Enum, default: AutoUpdate

Defines what to do on input changes.

Values:

Title Name Description
Off Off Does nothing on input changes.
Auto Update AutoUpdate Updates the output image automatically on any input change.
Auto Clear AutoClear Invalidates the output image on any input change.

Apply

name: apply, type: Trigger

If pressed, the output image is updated.

Hidden Fields

binaryIsActive

name: binaryIsActive, type: Bool, persistent: no, deprecated name: unaryOrBinary