BroadcastingMask¶
- MacroModule¶
author
package
definition
see also
keywords
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¶
Connect Inputs: Ensure that the input image and mask are connected to the
inImageandinMaskfields respectively.Select Parameters: Set the
ModeandBackground.Update: The
Updatewill compute the broadcasting.Clear: The
Clearcan 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¶
Input Fields¶
inImage¶
- name: inImage, type: Image¶
Input Image, used as reference
inMask¶
Output Fields¶
outImage¶
- name: outImage, type: Image¶
The output mask
Parameter Fields¶
Field Index¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
Mask |
Mask |
The broadcasted input mask is passed to the output. The output will have the same size of |
Inv Mask |
InvMask |
The broadcasted input mask is inverted and passed to the output. The output will have the same size of |
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 |
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 |
Mask Over Original |
MaskOverOriginal |
All mask pixels are blended with the original image with the given |
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 ( 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¶
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.