public final class KMeans
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
KMeans.Config
Configurable parameters of the k-means algorithm.
|
| Constructor and Description |
|---|
KMeans()
|
KMeans(KMeans.Config config)
|
| Modifier and Type | Method and Description |
|---|---|
int |
closestCluster(float[] x)
Find index of the cluster closest to the sample
x. |
ij.ImageStack |
getCentroidValueImage()
Returns stack where discovered clusters can be represented by
replacing pixel values in a
cluster by the value of the centroid of that cluster.
|
ij.ImageStack |
getClusterAnimation()
Return stack representing clustering optimization.
|
float[][] |
getClusterCenters()
Return location of cluster centers.
|
long |
getNumberOfStepsToConvergence()
|
ij.process.ByteProcessor |
run(ij.ImageStack stack)
Perform k-means clustering of the input
stack. |
public KMeans()
public KMeans(KMeans.Config config)
public ij.process.ByteProcessor run(ij.ImageStack stack)
stack. Elements of
the
stack must be of type FloatProcessor.
stack - stack representing a multi-band image.public float[][] getClusterCenters()
public ij.ImageStack getClusterAnimation()
null
value only when configuration parameters clusterAnimationEnabled is set to
true.
null.public ij.ImageStack getCentroidValueImage()
public long getNumberOfStepsToConvergence()
public int closestCluster(float[] x)
x.
run(ij.ImageStack)
must be run before calling this method.
x - test point, number of values must be the same is input stack size.
run(ij.ImageStack)