public final class KMeans2D
extends java.lang.Object
Constructor and Description |
---|
KMeans2D() |
KMeans2D(KMeansConfig config) |
Modifier and Type | Method and Description |
---|---|
int |
closestCluster(float[] x)
Find index of the cluster closest to the sample
x . |
protected void |
clusterAnimationAddCurrent(java.lang.String title) |
protected void |
clusterAnimationInitialize() |
protected ij.ImageStack |
encodeCentroidValueImage() |
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() |
protected float[][] |
initializeClusterCenters()
Initialize clusters using k-means++ approach, see http://en.wikipedia.org/wiki/K-means++
|
protected java.util.Iterator<float[]> |
newPixelIterator() |
protected int |
numberOfValues()
Number of values in a pixel
|
ij.process.ByteProcessor |
run(ij.ImageStack stack)
Perform k-means clustering of the input
stack . |
protected boolean |
supportsClusterAnimation() |
public KMeans2D()
public KMeans2D(KMeansConfig 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 ij.ImageStack getClusterAnimation()
null
value only when configuration parameters clusterAnimationEnabled
is set to
true.null
.protected int numberOfValues()
protected ij.ImageStack encodeCentroidValueImage()
protected java.util.Iterator<float[]> newPixelIterator()
protected float[][] initializeClusterCenters()
protected boolean supportsClusterAnimation()
protected void clusterAnimationInitialize()
protected void clusterAnimationAddCurrent(java.lang.String title)
public final ij.ImageStack getCentroidValueImage()
public final long getNumberOfStepsToConvergence()
public final float[][] getClusterCenters()
public final 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)