Purpose

The module ConnectedComponents performs a connected component analysis on 2D / 3D gray scale or vector images.

This module is deprecated. Please use ComputeConnectedComponents, FilterConnectedComponents, ConnectedComponentsToImage, and ConnectedComponentsInfo instead!

Usage

Connect an input image, select a Neighborhood Relation Used and a Background Value, and press Update. The leftmost output image now contains a label image where all interconnected non-background voxels are labeled with the same image value.

The module works only on the sub image identified by c = 0, t =0, and u = 0. Any other image part is filled with 0 for all outputs.

Tips

  • The analysis is very fast on images with few components, but can be extremely time-consuming for images with, say, a million clusters.
  • The Background Gray Value that shall be ignored (Background Gray Value) from the input image as well as the input image itself are casted to unsigned, so negative Background Gray Values maybe bring trouble.
  • In Similar Intensities cluster mode all input images are casted to uint32, so 64 Bit input is not handled correctly.

Windows

Default Panel

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

Input Fields

input0

name: input0, type: Image

A grayscale or vector image where connected components shall be identified.

input1

name: input1, type: Image

A mask image that defines which voxels in input0 are processed. Mask value 0 means the corresponding voxels in input0 are let out. The mask image must have same dimension as the input0 image.

inputMarkers

name: inputMarkers, type: XMarkerList(MLBase)

(Optional) marker list, used for output1 component (de)selection.

For accessing this object via scripting see the Scripting Reference: MLXMarkerListWrapper.

Output Fields

output0

name: output0, type: Image

A label image where all background voxels have the label 0, and foreground voxels have the label of their component. Labels range from 1 to Num. Remaining Components, with decreasing cluster size (number of component voxels).

output1

name: output1, type: Image

A label image holding only certain clusters derived from the input markers and the additional marker parameter.

output2

name: output2, type: Image

This image holds only the largest or smallest component, depending on Invert largest cluster (output all but the largest).

output3

name: output3, type: Image

For each voxel, the volume of the containing cluster is given in the unit defined by the parameter Cluster Size Interpretation. Background voxels have value 0.

Parameter Fields

Visible Fields

Update

name: update, type: Trigger, deprecated name: precompute

If pressed, the analysis is performed and the output images are updated.

Auto Update

name: autoUpdate, type: Bool, default: FALSE

If checked, the module computes anew on input change.

Use additional seed point

name: useAdditionalSeed, type: Bool, default: FALSE

Sets a seed with Position that is used in addition to those at the marker list input.

Position

name: additionalSeed, type: Vector6, default: 0 0 0 0 0 0

Sets a position of the additional seed point.

Only active if Use additional seed point is checked.

Type

name: additionalSeedType, type: Integer, default: 0

Sets the (marker) type of the additional seed point.

Only active if Use additional seed point is checked.

Interpretation

name: additionalSeedCoordSystem, type: Enum, default: VoxelCoordinates

Defines the coordinate system for the additional seed point Position.

Values:

Title Name
Voxel Coordinates VoxelCoordinates
World Coordinates WorldCoordinates

Cluster Mode

name: clusterMode, type: Enum, default: IdenticalIntensities

Defines the cluster rule.

Values:

Title Name Description
Identical Intensities IdenticalIntensities The intensities or vector directions of adjacent voxels need to be identical to form a cluster.
Similar Intensities SimilarIntensities

The intensities of adjacent voxels need to be similar to form a cluster.

Set the similarity tolerance with Similarity Tolerance.

Similar Vector Directions SimilarVectorDirections

The vector directions of adjacent voxels need to be identical to form a cluster.

Set the similarity tolerance with Similarity Dot-Product. This is the threshold for the dot-product of vectors in adjacent voxels.

Similarity Tolerance

name: similarityToleranceIntensities, type: Double, default: 0

Sets the tolerance for the Cluster Mode Similar Intensities.

Similarity Dot-Product

name: similarityToleranceVectors, type: Double, default: 0.98

Sets the tolerance for the Cluster Mode Similar Vector Directions.

Output largest cluster on each slice (2D)

name: outputLargestClusterOnEachSlice, type: Bool, default: FALSE

If checked, the largest cluster on each slice is computed for output2 if the module’s Neighborhood Relation Used is a 2D type.

Num. Remaining Components

name: numberOfClusters, type: Integer, persistent: no

Shows the number of components found and not filtered out by the size filter set by Minimum Cluster Size.

Background Value

name: fillValue, type: Integer, default: 0

Sets the background value for the output image.

Keep object values from input

name: originalObject, type: Bool, default: FALSE

If checked, the component values for the largest (or smallest) cluster are taken from the input image. The remaining clusters obtain their values from the cluster order.

New Object Value

name: objectValue, type: Integer, default: 255

Shows the value of the selected component if Keep object values from input is unchecked.

Minimum Cluster Size

name: minClusterSize, type: Double, default: 0

Sets an amount of voxel to limit the output clusters’ size (see Cluster Size Interpretation for units).

Maximum Cluster Size

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

Sets an amount of voxel to limit the output clusters’ size (see Cluster Size Interpretation for units).

If this field is set to a value < 0, it is ignored.

Cluster Size Interpretation

name: clusterSizeInterpretation, type: Enum, default: ml

Defines the unit for Minimum Cluster Size.

Values:

Title Name Deprecated Name
Voxels Voxels  
ml ml Volume (ml)

Invert manual cluster selection

name: invertClusterSelection, type: Bool, default: FALSE

If checked, not the clusters selected by the markers are shown at the second output, but those who are not selected. For the rightmost output this means that all clusters except the largest are shown.

Invert largest cluster (output all but the largest)

name: invertLargestCluster, type: Bool, default: FALSE

If checked, all but the largest cluster is output.

Use Background Value

name: useBackgroundValue, type: Bool, default: TRUE

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

Background Gray Value

name: backgroundValue, type: Double, default: 0, deprecated name: inputIgnoreValue

Sets the voxel value to be ignored. The background value function is not used in vector mode.

Neighborhood Relation Used

name: neighborhoodType, type: Enum, default: NBH_3D_18_XYZ

Defines the connectedness relation for the analysis.

Values:

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

Use input mask image

name: useMask, type: Bool, default: FALSE

If checked, the input mask is used.