Purpose

The module ComputeConnectedComponents computes voxel clusters as connected components.

Details

A connected component is a set of neighboring voxels with similar values. The similarity function can vary, it can be the identity (neighboring voxels need the exact same value) or it can be that the difference of the voxel values needs to be smaller than some epsilon.

The module can work on scalar and on vector images. The similarity of vectors is computed as the dot-product which needs to be larger than Similarity Tolerance Vectors.

If the module should work on a scalar image but the Cluster Mode is set to SimilarVectorDirections, the module will internally switch to the cluster mode SimilarIntensities.

If the module should work on a vector image but the cluster mode is set to SimilarIntensities or IdenticalIntensities, the module will internally switch to the cluster mode SimilarVectorDirections.

The output of this module is a Base structure containing the cluster information as well as selection/filtering information.

Note The module only works on the first X/Y/Z dimension. It only computes clusters for values in the layer of the C/T/U dimensions. For computing clusters in higher C/T/U dimensions, use SubImage to ‘move’ the higher dimensions in C/T/U to the first entry.

Windows

Default Panel

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

Input Fields

input0

name: input0, type: Image

Input image where the voxels are to be clustered.

input1

name: input1, type: Image

Input mask image, needs to have the same extent and matrix as the input0 image. Only those voxels in input0 are clustered where the corresponding voxel in the mask image has a value != 0.

Output Fields

outClusters

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

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 cluster structure anew.

Update

name: update, type: Trigger

If pressed, the module computes its output cluster structure anew.

Clear

name: clear, type: Trigger

If pressed, the module’s output is cleared.

Neighborhood Relation

name: neighborhoodRelation, type: Enum, default: NBH_3D_18_XYZ

Defines the neighborhood voxel relation which is used to compute the clusters.

Values:

Title Name
2D-4-Neighborhood (x,y) NBH_2D_4_XY
2D-8-Neighborhood (x,y) NBH_2D_8_XY
3D-6-Neighborhood (x,y,z) NBH_3D_6_XYZ
3D-18-Neighborhood (x,y,z) NBH_3D_18_XYZ
3D-26-Neighborhood (x,y,z) NBH_3D_26_XYZ

Background Value

name: backgroundValue, type: Double, default: 0

Sets a background value for the cluster computation; all voxels with this value are considered background, whether the voxels are connected by a neighborhood relation or not.

Use Background Value

name: useBackgroundValue, type: Bool, default: TRUE

If checked, the background value is ignored, all voxels are subject to clustering.

Use Mask

name: useMask, type: Bool, default: FALSE

If checked, the module expects an attached mask image; only voxels where the mask image is != 0 are considered for the cluster analysis, all other voxels will be considered background voxels.

Cluster Mode

name: clusterMode, type: Enum, default: IdenticalIntensities

Defines the similarity function for clustering.

Values:

Title Name Description
Identical Intensities IdenticalIntensities Scalar: Neighboring voxels need to have the exact same value.
Similar Intensities SimilarIntensities Scalar: The difference of neighboring voxel values needs to be less or equal the value of Similarity Tolerance Intensities.
Similar Vector Directions SimilarVectorDirections Vector: The dot product of neighboring voxel vectors needs to be greater or equal the value of Similarity Tolerance Vectors.

User Data Default

name: userDataDefault, type: Enum, default: ImageValue

Defines which value is set as default to the user data.

Note that this option is only available if the Cluster Mode is set to Identical Intensities.

For the other modes, the cluster size in milliliter is set as user data by default.

Values:

Title Name Description
Image Value ImageValue The image value is set as user data.
Volume In Ml VolumeInMl The cluster size in milliliter is set as user data.

Similarity Tolerance Intensities

name: similarityToleranceIntensities, type: Double, default: 0

Sets the epsilon value for scalar value comparison.

Similarity Tolerance Vectors

name: similarityToleranceVectors, type: Double, default: 0.98

Sets the epsilon value for vector direction comparison.

Hidden Fields

progress

name: progress, type: Double, persistent: no