Purpose

The module ConnectedComponentsToImage converts a cluster structure back to an ML image.

Details

The image information (image extent, page extent, world-to-voxel matrix) is stored in the cluster structure and is used to set up the module’s output image.

The clusters are ranked by their size. The largest cluster has the rank 1, the second largest cluster has the rank 2, and so on. If clusters have the same size, the rank may differ on different platforms (OS, compiler), because the sorting function may behave differently. The background has always rank 0, although it may not be larger than the cluster with rank 1.

Windows

Default Panel

../../../Modules/ML/MLCluster/mhelp/Images/Screenshots/ConnectedComponentsToImage._default.png

Input Fields

inClusters

name: inClusters, type: SelectedClusters(MLBase)
For accessing this object via scripting see the Scripting Reference: MLSelectedClustersWrapper.

Output Fields

output0

name: output0, type: Image

Parameter Fields

Visible Fields

Update Mode

name: updateMode, type: Enum, default: AutoClear

Defines the update behavior of this module.

Values:

Title Name Description
Clear AutoClear On any input or parameter field change, the module clears its output.
Update AutoUpdate On any input or parameter field, the module computes the output ML image anew.

Update

name: update, type: Trigger

If pressed, the output ML image is computed anew.

Clear

name: clear, type: Trigger

If pressed, the module’s output is cleared.

Write To Image Mode

name: writeToImageMode, type: Enum, default: Rank

Defines the mode that is used to write the cluster information to the output ML image.

Values:

Title Name Description
Rank Rank The rank of each cluster is set as the voxel value.
Num Voxels NumVoxels

The number of voxels is written as a voxel value for each voxel of a cluster.

Background voxels are set to 0.

Volume In Milliliters VolumeInMilliliters The volume of the cluster in milliliter is written as a voxel value.
Fixed Values FixedValues Fixed values for cluster objects and for the background are written. Each cluster voxel will have the same value in the output image.
User Data UserData

The user data value of each cluster is written as a voxel value.

By default, the user data value of a cluster is set to its rank. By Python scripting, the user data can be set to any value of type double.

Cluster Value

name: clusterValue, type: Double, default: 1

Sets a cluster object value if Write To Image Mode is set to Fixed.

Background Value

name: backgroundValue, type: Double, default: 0

Sets a background value if Write To Image Mode is set to Fixed.

Use Bounding Box Of Selected Clusters

name: useBoundingBoxOfSelectedClusters, type: Bool, default: FALSE

If checked, the output image is only as big as the selected clusters’ bounding box.