MinMaskDistance¶
- MacroModule¶
author
Torben Paetz
package
definition
see also
keywords
Purpose¶
The MinMaskDistance computes the minimal Euclidean distance between two mask objects and reports the result in Min Mask Distance.
Usage¶
Connect the first mask image to
inFirstMask.n2. Connect the second mask image toinSecondMask.n3. TriggerUpdateto run the computation manually, or setOn Input Change Behaviorto Update for automatic recomputation on input changes.n4. Read the minimal distance fromMin Mask Distanceand checkHas Valid Output,Status Code, andStatus Messagefor 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¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
inFirstMaskand the object ininSecondMask.
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 |
[]¶
- 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.