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:
ActionListener,WindowListener,Runnable,EventListener
- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[][]private doubleprivate float[]private double[][]private double[][]private double[][]private double[]private boolean[]private float[]private int[]private int[]private intprivate ModelImageprivate int[]private intprivate int[]private charprivate double[][]private intprivate intprivate intprivate intprivate int[]private double[][]private charprivate float[]private Stringprivate double[]private double[]private doubleprivate booleanprivate int[]private charprivate booleanprivate double[]private double[][]private double[][]Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmSpectralClustering(ModelImage image, double[][] pos, double[] scale, int[] groupNum, double[][] centroidPos, String resultsFileName, float[] redBuffer, float[] greenBuffer, float[] blueBuffer, double scaleMax, boolean scaleVariablesToUnitVariance) -
Method Summary
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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
image
-
scale
private double[] scale -
pos
private double[][] pos -
groupNum
private int[] groupNum -
centroidPos
private double[][] centroidPos -
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 Details
-
AlgorithmSpectralClustering
public AlgorithmSpectralClustering(ModelImage image, double[][] pos, double[] scale, int[] groupNum, double[][] centroidPos, String resultsFileName, float[] redBuffer, float[] greenBuffer, float[] blueBuffer, double scaleMax, boolean scaleVariablesToUnitVariance)
-
-
Method Details
-
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()
-