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[][]
A
private double
abstol
private float[]
blueBuffer
private double[][]
centroidDistances
private double[][]
centroidPos
private double[][]
D
private double[]
eigenvalues
private boolean[]
found
private float[]
greenBuffer
private int[]
groupNum
private int[]
ifail
private int
il
private ModelImage
image
private int[]
info
private int
iu
private int[]
iwork
private char
jobz
private double[][]
L
private int
lwork
private int
nDims
private int
nPoints
private int
numberClusters
private int[]
numEigenvaluesFound
private double[][]
pos
private char
range
private float[]
redBuffer
private java.lang.String
resultsFileName
private double[]
scale
private double[]
scale2
private double
scaleMax
private boolean
scaleVariablesToUnitVariance
private int[]
totalWeight
private char
uplo
private boolean
useColorHistogram
private double[]
work
private double[][]
X
private 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 double
eval(double sigma)
void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Starts the algorithm.private void
selfTest()
-
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:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
eval
private double eval(double sigma)
-
selfTest
private void selfTest()
-
-