Package gov.nih.mipav.model.algorithms
Class AlgorithmSpectralClustering
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmSpectralClustering
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmSpectralClustering extends AlgorithmBase
- Author:
- William Gandler This program is an implementation of the algorithm described in "On Spectral Clustering: Analysis and an algorithm" by Andrew Y. Ng, Michael I. Jordan, and Yair Weiss. This forms clusters of nonconvex objects in black and white images or in text data files.
-
-
Field Summary
Fields Modifier and Type Field Description private double[][]Aprivate doubleabstolprivate float[]blueBufferprivate double[][]centroidDistancesprivate double[][]centroidPosprivate double[][]Dprivate double[]eigenvaluesprivate boolean[]foundprivate float[]greenBufferprivate int[]groupNumprivate int[]ifailprivate intilprivate ModelImageimageprivate int[]infoprivate intiuprivate int[]iworkprivate charjobzprivate double[][]Lprivate intlworkprivate intnDimsprivate intnPointsprivate intnumberClustersprivate int[]numEigenvaluesFoundprivate double[][]posprivate charrangeprivate float[]redBufferprivate java.lang.StringresultsFileNameprivate double[]scaleprivate double[]scale2private doublescaleMaxprivate booleanscaleVariablesToUnitVarianceprivate int[]totalWeightprivate charuploprivate booleanuseColorHistogramprivate double[]workprivate double[][]Xprivate double[][]Y-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmSpectralClustering(ModelImage image, double[][] pos, double[] scale, int[] groupNum, double[][] centroidPos, java.lang.String resultsFileName, float[] redBuffer, float[] greenBuffer, float[] blueBuffer, double scaleMax, boolean scaleVariablesToUnitVariance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private doubleeval(double sigma)voidfinalize()Prepares this class for destruction.voidrunAlgorithm()Starts the algorithm.private voidselfTest()-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
image
private ModelImage image
-
scale
private double[] scale
-
pos
private double[][] pos
-
groupNum
private int[] groupNum
-
centroidPos
private double[][] centroidPos
-
resultsFileName
private java.lang.String resultsFileName
-
redBuffer
private float[] redBuffer
-
greenBuffer
private float[] greenBuffer
-
blueBuffer
private float[] blueBuffer
-
scaleMax
private double scaleMax
-
useColorHistogram
private boolean useColorHistogram
-
scaleVariablesToUnitVariance
private boolean scaleVariablesToUnitVariance
-
nDims
private int nDims
-
nPoints
private int nPoints
-
numberClusters
private int numberClusters
-
A
private double[][] A
-
scale2
private double[] scale2
-
D
private double[][] D
-
L
private double[][] L
-
jobz
private char jobz
-
range
private char range
-
uplo
private char uplo
-
il
private int il
-
iu
private int iu
-
abstol
private double abstol
-
numEigenvaluesFound
private int[] numEigenvaluesFound
-
eigenvalues
private double[] eigenvalues
-
X
private double[][] X
-
work
private double[] work
-
lwork
private int lwork
-
iwork
private int[] iwork
-
ifail
private int[] ifail
-
info
private int[] info
-
found
private boolean[] found
-
Y
private double[][] Y
-
totalWeight
private int[] totalWeight
-
centroidDistances
private double[][] centroidDistances
-
-
Constructor Detail
-
AlgorithmSpectralClustering
public AlgorithmSpectralClustering(ModelImage image, double[][] pos, double[] scale, int[] groupNum, double[][] centroidPos, java.lang.String resultsFileName, float[] redBuffer, float[] greenBuffer, float[] blueBuffer, double scaleMax, boolean scaleVariablesToUnitVariance)
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-
eval
private double eval(double sigma)
-
selfTest
private void selfTest()
-
-