MinMaskDistance

MacroModule

author

Torben Paetz

package

FMEstable/ReleaseMeVis

definition

MinMaskDistance.def

see also

MaskSurfaceDistance

keywords

minimal, mask, distace

Purpose

The MinMaskDistance computes the minimal Euclidean distance between two mask objects and reports the result in Min Mask Distance.

Usage

  1. Connect the first mask image to inFirstMask.n2. Connect the second mask image to inSecondMask.n3. Trigger Update to run the computation manually, or set On Input Change Behavior to Update for automatic recomputation on input changes.n4. Read the minimal distance from Min Mask Distance and check Has Valid Output, Status Code, and Status Message for validity information.

Details

The module expects two binary/label masks where object voxels are represented by value 1. Internally, it computes object-aligned bounding boxes, composes them into a common geometry, calculates a Euclidean distance transform, and evaluates the minimal distance value inside the second mask region.nnIf both masks overlap, the minimal distance is typically 0. If masks are separated, the returned value is the shortest Euclidean distance between both objects in image space.

Interaction

The default panel shows the scalar result field and standard AlgorithmMacroModule control/status fields. Use Update for explicit execution, Clear to reset output state, and On Input Change Behavior to control automatic behavior when inputs change.

Tips

Provide clean mask inputs (single object label value 1) to obtain robust distances. Use consistent image orientation and voxel spacing for meaningful metric interpretation. If you process a changing stream of inputs, set On Input Change Behavior to Update to keep results current automatically.

Windows

The default window displays the computed minimum distance and the standard update/clear/status controls.

Default Panel

Shows Min Mask Distance and the common algorithm control/status fields for updating, clearing, and checking validity.

Input Fields

Connect two mask images describing the objects whose minimal distance should be measured.

inFirstMask

name: inFirstMask, type: Image

First input mask image (object voxels expected at value 1).

inSecondMask

name: inSecondMask, type: Image

Second input mask image (object voxels expected at value 1).

Parameter Fields

Field Index

[]: Trigger

Update: Trigger

Clear: Trigger

doNotClearOnFailedUpdate: Bool

Has Valid Output: Bool

Min Mask Distance: Double

On Input Change Behavior: Enum

Status Code: Enum

Status Message: String

Use the AlgorithmMacroModule control fields to trigger updates, reset state, and inspect whether the latest result is valid.

Visible Fields

Min Mask Distance

name: outMinMaskDistance, type: Double, persistent: no

Computed minimal Euclidean distance between the object in inFirstMask and the object in inSecondMask.

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

Description

Update

Update

TRUE

Recompute outputs when an input changes.

Clear

Clear

FALSE

Clear outputs when an input changes; run Update manually afterward.

[]

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

Description

Ok

Ok

Last update completed successfully.

Invalid input object

Invalid input object

At least one required input object is missing or invalid.

Invalid input parameter

Invalid input parameter

A required parameter value is invalid for computation.

Internal error

Internal error

An unexpected internal error occurred during update.

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.