Purpose

The module FuzzyCluster implements a fuzzy c-means algorithm that classifies an image into different clusters depending on the gray values.

Image voxels get a membership value ranging from 0 to 1 for each cluster. This permits for example to segment regions of the image by choosing clusters and membership thresholds.

Usage

Choose a number of classes you want the image to be classified into. Press the Calculate Cluster button. Since the calculation can be quite time-consuming, it is only started on demand and even then only if essential fields (like Fuzziness, Epsilon, etc.) were changed.

output1 always shows all clusters, with voxels being assigned to the clusters in which they have the highest membership (this is what you usually want). To be able to see something at output0 you also have to provide one or more valid markers at the inputMarkersVol input. After changing the markers you will need to press Calculate Cluster again, to see the clusters corresponding to the marked voxels. By adjusting the Membership Threshold you can define how high the membership of a voxel in relation to the chosen clusters have to be to be included in the output0 image.

It is highly recommended to use only images of an integer type (int, uint, etc.) as input!

The calculation time is significantly higher for float images, and big non-integer images the module cannot even handle.

Details

For details about the algorithm, read this.

Windows

Default Panel

../../../Modules/ML/MLFuzzy/mhelp/Images/Screenshots/FuzzyCluster._default.png

Input Fields

input0

name: input0, type: Image

The scalar input image.

inputMarkersVol

name: inputMarkersVol, type: XMarkerList(MLBase)

XMarkerList for selecting a specific cluster for output0.

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

Output Fields

output0

name: output0, type: Image

Output image showing the selected clusters.

The background voxels have value 0, the cluster voxels maximum image value.

output1

name: output1, type: Image

Output image showing all clusters.

The gray value of a voxel represents the index of the cluster it most belongs to.

Parameter Fields

Field Index

acceptedMarkerType: Integer Max Membership Difference: Double Use gray value limit: Bool
Calculate Cluster: Trigger maxSize: Integer Value of Center: Double
Cluster Index: Integer Membership Threshold: Double weight: Double
Epsilon: Double noSeeds: Integer  
forceFullFCM: Bool Num Classes: Integer  
Fuzziness: Double objects: Integer  
Iteration Limit: Integer Performed Iterations: Integer  
Lower Gray Value Limit: Double Upper Gray Value Limit: Double  

Visible Fields

Num Classes

name: classes, type: Integer, default: 3

Sets the number of clusters the image will be clustered into.

Max Membership Difference

name: calcCounter, type: Double, persistent: no

Shows the value difference between the current and the previous calculation.

Epsilon

name: epsilon, type: Double, default: 0.3, minimum: 0, maximum: 1

Sets the stopping condition for the fuzzy c-mean iteration.

As long as the difference between the current and the previous iteration is greater than Epsilon, the iteration will continue.

Membership Threshold

name: threshold, type: Double, default: 0.5, minimum: 0, maximum: 1

Sets a threshold to include more cluster voxels to the selected cluster in output0.

Voxels with a difference to the selected cluster voxels within this threshold are added to the selected cluster.

Fuzziness

name: fuzziness, type: Double, default: 2, minimum: 1, maximum: 5

Sets the fuzzyness parameter.

Calculate Cluster

name: cluster, type: Trigger

If pressed, the module computes the output anew.

Use gray value limit

name: useGrayValueLimit, type: Bool, default: FALSE

If checked, the module only works on voxels with a value within Lower Gray Value Limit and Upper Gray Value Limit.

Lower Gray Value Limit

name: lowerGrayValueLimit, type: Double, default: 0

Sets the lower gray value limit for cluster computation.

Upper Gray Value Limit

name: upperGrayValueLimit, type: Double, default: 4095

Sets the upper gray value limit for cluster computation.

Cluster Index

name: clusterIndex, type: Integer, default: 0

Sets the index of the cluster about which information should be displayed.

Value of Center

name: clusterCenterGray, type: Double, persistent: no

Shows the gray value of the center of the cluster selected with Cluster Index.

Iteration Limit

name: iterationLimit, type: Integer, default: 1000

Sets the maximum amount of iterations that are performed in the Fuzzy-C-Means calculation.

This is needed for cases where the fuzzy clustering does not converge.

A value of 0 means no limit.

Performed Iterations

name: performedIterations, type: Integer, persistent: no

Shows the number of performed iterations.

If this field shows the same number as Iteration Limit, the fuzzy clustering probably did not converge.

Hidden Fields

noSeeds

name: noSeeds, type: Integer, default: 0

acceptedMarkerType

name: acceptedMarkerType, type: Integer, default: -1

maxSize

name: maxSize, type: Integer, default: 0

objects

name: objects, type: Integer, default: 4

weight

name: weight, type: Double, default: 1

forceFullFCM

name: forceFullFCM, type: Bool, default: FALSE