FilterConnectedComponentsPerLabel

MacroModule

genre

Region

author

Felix Thielke

package

FMEstable/ReleaseMeVis

definition

FilterConnectedComponentsPerLabel.def

see also

ComputeConnectedComponents, FilterConnectedComponents

keywords

cluster, select

Purpose

The FilterConnectedComponentsPerLabel filters connected component clusters by their size and selects them per label, exposing the resulting selection through outClusters.

Usage

  1. Connect an MLSelectedClustersWrapper (e.g. the output of ComputeConnectedComponents) to inClusters.n2. Configure the size bounds [ and , and choose their unit via ].n3. Select the desired behavior in Selection Mode.n4. Trigger Update to apply the filter, or set On Input Change Behavior to Update for automatic recomputation. Read the selection from outClusters and check Has Valid Output, Status Code, and Status Message for validity information.

Details

The module expects a connected components object (inClusters, an MLSelectedClustersWrapper) whose individual clusters carry a per-label user data value. Based on the size bounds and their interpretation, a size range is derived for each cluster.nnIf ] is set to ml, the configured bounds are converted from milliliters to voxel counts using the voxel volume of the clusters. A maximum size below 0 is treated as unbounded.nnAll clusters are first deselected. Then, depending on Selection Mode, either every cluster whose size lies within the range is selected (All Filtered), or only the largest qualifying cluster per label is selected (Largest Per Label). The modified selection is passed through to outClusters.

Interaction

The default panel shows a Filtering box with Selection Mode and the cluster size range controls ([, ,, ]), followed by the standard AlgorithmMacroModule update, clear, and status fields.

Tips

Set , to a value below 0 to disable the upper size bound. When working with physical measurements, keep ] set to ml so bounds are expressed in volume; otherwise switch to Voxels to filter by voxel count directly. Use Largest Per Label to obtain a single representative cluster per label rather than all qualifying clusters.

Windows

The default window displays the filtering controls (selection mode and cluster size range) together with the standard update, clear, and status controls.

Default Panel

Shows Selection Mode and the cluster size range controls ([, ,, ]) as well as the common algorithm control/status fields.

Input Fields

Connect a connected components object whose clusters should be filtered and selected.

inClusters

name: inClusters, type: MLBase

Input connected components object (MLSelectedClustersWrapper) containing the clusters to filter and select.

Output Fields

The filtered cluster selection, propagated from the input.

outClusters

name: outClusters, type: MLBase

The same clusters object as inClusters with the selection updated according to the configured filter and selection mode.

Parameter Fields

Field Index

,: Double

Selection Mode: Enum

[: Double

Status Code: Enum

[]: Trigger

Status Message: String

]: Enum

Update: Trigger

Clear: Trigger

doNotClearOnFailedUpdate: Bool

Has Valid Output: Bool

On Input Change Behavior: Enum

Configure which clusters should be selected (selection mode, size bounds, and their interpretation) and use the AlgorithmMacroModule control fields to trigger updates, reset state, and inspect whether the latest result is valid.

Visible Fields

Selection Mode

name: inSelectionMode, type: Enum, default: LargestPerLabel

Controls which clusters are selected after filtering by size: either only the largest qualifying cluster per label, or all clusters matching the configured size range.

Values:

Title

Name

Description

Largest Per Label

LargestPerLabel

Selects only the largest cluster per label among those within the configured size range.

All Filtered

AllFiltered

Selects all clusters whose size lies within the configured size range.

[

name: inMinClusterSize, type: Double, default: 0, minimum: 0

Minimum cluster size for selection; smaller clusters are filtered out. Units are determined by ].

,

name: inMaxClusterSize, type: Double, default: -1

Maximum cluster size for selection; larger clusters are filtered out. A value below 0 means no upper bound. Units are determined by ].

]

name: inClusterSizeInterpretation, type: Enum, default: ml

Specifies whether the size bounds [ and , are interpreted in milliliters (ml) or in voxel counts.

Values:

Title

Name

Description

ml

ml

Interprets the size bounds in milliliters, converted to voxel counts using the clusters’ voxel volume.

Voxels

Voxels

Interprets the size bounds directly as voxel counts.

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.