BroadcastingMask

MacroModule

author

Felix Thielke

package

FMEstable/ReleaseMeVis

definition

BroadcastingMask.def

see also

MaskedBypass

keywords

mask, broadcast

Purpose

The BroadcastingMask broadcasts (replicates) a mask to match the size of an input image, before applying it on the input image. This module ensures that the input mask is broadcasted to the dimensions of the input image, allowing for operations that require both the image and mask to be of the same size. The values of the output is a combination of input image and the broadcasted Mask, depending on the input Mode.

Usage

  1. Connect Inputs: Ensure that the input image and mask are connected to the inImage and inMask fields respectively.

  2. Select Parameters: Set the Mode and Background.

  3. Update: The Update will compute the broadcasting.

  4. Clear: The Clear can be used to clear the output.

  • InputObjectError: Raised if the input image or mask is invalid.

  • InternalError: Raised if the image and mask shapes do not match.

  • Ensure that the input image and mask are valid and properly connected before running the module.

  • The replication vector is computed based on the dimensions of the input image and mask. The mask dimensions should either match the image dimensions or be broadcastable (size=1) to the image dimensions.

Windows

Default Panel

../../../Projects/BroadcastingMask/Modules/mhelp/Images/Screenshots/BroadcastingMask._default.png

Input Fields

inImage

name: inImage, type: Image

Input Image, used as reference

inMask

name: inMask, type: Image

Input Mask to be broadcasted to the inImage

Output Fields

outImage

name: outImage, type: Image

The output mask

Parameter Fields

Field Index

[]: Trigger

Status Code: Enum

Background: Double

Status Message: String

Blending: Double

Update: Trigger

Clear: Trigger

doNotClearOnFailedUpdate: Bool

Has Valid Output: Bool

Mode: Enum

On Input Change Behavior: Enum

Visible Fields

Mode

name: inMode, type: Enum, default: MaskedOriginal

Defines if and how the image should be masked by the broadcasted mask.

Values:

Title

Name

Description

​Original

​Original

​The input image inImage is passed to the output.

​Mask

​Mask

​The broadcasted input mask is passed to the output. The output will have the same size of inImage but the replicated values from inMask.

​Inv Mask

​InvMask

​The broadcasted input mask is inverted and passed to the output. The output will have the same size of inImage but the values are inverse of replicated values from inMask.

​Masked Original

​MaskedOriginal

​All voxels from the input image are passed unchanged to the output if non-zero values are found at their positions in the broadcasted Mask. Otherwise Background values are passed to the output.

​Masked Original On White

​MaskedOriginalOnWhite

​If a pixel in broadcasted Mask has a non-zero value, the corresponding pixel from input image is copied to the output unchanged. Otherwise, the output will take the maximum value from the entire input image instead.

​Masked Original Inv

​MaskedOriginalInv

​Input image where mask values are zero, and background value elsewhere.

All pixels from the inImage are passed unchanged to the output if zero values are found at their positions in the broadcasted Mask. Otherwise Background values are set to the output.

​Mask Over Original

​MaskOverOriginal

​All mask pixels are blended with the original image with the given Blending weight.

​Mask In Original

​MaskInOriginal

​All non-zero replicated Mask pixels are blended with the original input image with 0.5 weight.

Original pixels at zero mask positions are not modified.

​Inv Mask In Original

​InvMaskInOriginal

​All pixels from the input image (inImage) are passed unchanged to the output if non-zero values are found at their positions in the replicated Mask.

Otherwise the voxel from the first input is multiplied with 0.5.

​Inv Original

​InvOriginal

​All pixels from the input image are subtracted from the image maximum and the image minimum is added.

So the values are flipped between image minimum and image maximum value which leads to a visible inversion.

Background

name: inBackground, type: Double, default: 0

Sets the background value used in various modes.

Blending

name: inBlending, type: Double, default: 0.5, minimum: 0, maximum: 1

Sets a blending weight for the Mode settings MaskOverOriginal and MaskInOriginal.

Update

name: update, type: Trigger

Initiates update of all output field values.

Clear

name: clear, type: Trigger

Clears all output field values to a clean initial state.

On Input Change Behavior

name: onInputChangeBehavior, type: Enum, default: Clear, deprecated name: shouldAutoUpdate,shouldUpdateAutomatically

Declares how the module should react if a value of an input field changes.

Values:

Title

Name

Deprecated Name

​Update

​Update

​TRUE

​Clear

​Clear

​FALSE

[]

name: updateDone, type: Trigger, persistent: no

Notifies that an update was performed (Check status interface fields to identify success or failure).

Has Valid Output

name: hasValidOutput, type: Bool, persistent: no

Indicates validity of output field values (success of computation).

Status Code

name: statusCode, type: Enum, persistent: no

Reflects module’s status (successful or failed computations) as one of some predefined enumeration values.

Values:

Title

Name

​Ok

​Ok

​Invalid input object

​Invalid input object

​Invalid input parameter

​Invalid input parameter

​Internal error

​Internal error

Status Message

name: statusMessage, type: String, persistent: no

Gives additional, detailed information about status code as human-readable message.

Hidden Fields

doNotClearOnFailedUpdate

name: doNotClearOnFailedUpdate, type: Bool, persistent: no

Prevents automated clear after update failed. This does not affect status fields. It enables the developer to analyze module’s state after failure.