public final class KMeans3D
extends java.lang.Object
Constructor and Description |
---|
KMeans3D() |
KMeans3D(KMeansConfig config) |
Modifier and Type | Method and Description |
---|---|
int |
closestCluster(float[] x)
Find index of the cluster closest to the sample
x . |
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.
|
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 net.sf.ij_plugins.clustering.StackPixelIterator |
newPixelIterator() |
protected int |
numberOfValues()
Number of values in a pixel
|
ij.ImageStack |
run(ij.ImageStack stack)
Perform k-means clustering of the input
stack . |
public KMeans3D()
public KMeans3D(KMeansConfig config)
public ij.ImageStack run(ij.ImageStack stack)
stack
.stack
- stack representing a 3D image.protected int numberOfValues()
protected ij.ImageStack encodeCentroidValueImage()
protected net.sf.ij_plugins.clustering.StackPixelIterator newPixelIterator()
protected float[][] initializeClusterCenters()
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)