Package gov.nih.mipav.model.algorithms
Class AlgorithmGaussianMixtureModelEM
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmGaussianMixtureModelEM
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmGaussianMixtureModelEM extends AlgorithmBase
Copyright (c) 1995 The Board of Trustees of Purdue University. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. In no event shall Purdue University be liable to any party for direct, indirect, special, incidental, or consequential damages arising out of the use of this software and its documentation, even if Purdue University has been advised of the possibility of such damage. Purdue University specifically disclaims any warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The software provided hereunder is on an "as is" basis, and Purdue Univeristy has no obligation to provide maintenance, support, updates, enhancements, or modifications. This is a port of cluster-3.6.7 developed by: Charles A. Bouman; School of ECE, Purdue University Michael Shapiro; NCSA Gregory W. Cook; School of ECE, Purdue University C. Brian Atkins; School of ECE, Purdue University Hui Cheng; School of ECE, Purdue University Jennifer G. Dy; School of ECE, Purdue University Sean Borman; Department of Electrical Engineering, University of Notre Dame This is software for doing unsupervised clustering. This is done by estimating the parameters of a Gaussian mixture model using the EM algorithm.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AlgorithmGaussianMixtureModelEM.ClassData
(package private) class
AlgorithmGaussianMixtureModelEM.ClassSig
(package private) class
AlgorithmGaussianMixtureModelEM.SigSet
(package private) class
AlgorithmGaussianMixtureModelEM.SubSig
-
Field Summary
-
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 AlgorithmGaussianMixtureModelEM()
AlgorithmGaussianMixtureModelEM(int clusterMessageVerboseLevel, int init_num_of_subclasses, java.lang.String input_file_directory, java.lang.String input_file_name, java.lang.String parameter_output_file_directory, java.lang.String parameter_output_file_name, boolean full, int number_of_clusters)
AlgorithmGaussianMixtureModelEM(java.lang.String parameter_input_file_directory, java.lang.String parameter_input_file_name, java.lang.String file_directory, java.lang.String file_name, boolean classify)
-
Method Summary
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
clusterMessageVerboseLevel
private int clusterMessageVerboseLevel
-
init_num_of_subclasses
private int init_num_of_subclasses
-
input_file_directory
private java.lang.String input_file_directory
-
input_file_name
private java.lang.String input_file_name
-
data_file_directory
private java.lang.String data_file_directory
-
data_file_name
private java.lang.String data_file_name
-
parameter_input_file_directory
private java.lang.String parameter_input_file_directory
-
parameter_input_file_name
private java.lang.String parameter_input_file_name
-
parameter_output_file_directory
private java.lang.String parameter_output_file_directory
-
parameter_output_file_name
private java.lang.String parameter_output_file_name
-
full
private boolean full
-
number_of_clusters
private int number_of_clusters
-
SIGNATURE_TYPE_MIXED
private final int SIGNATURE_TYPE_MIXED
- See Also:
- Constant Field Values
-
COVAR_DYNAMIC_RANGE
private double COVAR_DYNAMIC_RANGE
-
CLUSTER_FULL
private final int CLUSTER_FULL
- See Also:
- Constant Field Values
-
CLUSTER_DIAG
private final int CLUSTER_DIAG
- See Also:
- Constant Field Values
-
Smin
private AlgorithmGaussianMixtureModelEM.SigSet Smin
-
compute_constants_indx
private int[] compute_constants_indx
-
compute_constants_y
double[][] compute_constants_y
-
compute_constants_col
double[] compute_constants_col
-
compute_constants_first
private boolean compute_constants_first
-
reduce_order_S
private AlgorithmGaussianMixtureModelEM.SigSet reduce_order_S
-
reduce_order_Sig3
private AlgorithmGaussianMixtureModelEM.ClassSig reduce_order_Sig3
-
reduce_order_SubSig3
AlgorithmGaussianMixtureModelEM.SubSig reduce_order_SubSig3
-
reduce_order_first
private boolean reduce_order_first
-
distance_S
private AlgorithmGaussianMixtureModelEM.SigSet distance_S
-
distance_Sig3
private AlgorithmGaussianMixtureModelEM.ClassSig distance_Sig3
-
distance_SubSig3
private AlgorithmGaussianMixtureModelEM.SubSig distance_SubSig3
-
distance_first
private boolean distance_first
-
-
Constructor Detail
-
AlgorithmGaussianMixtureModelEM
public AlgorithmGaussianMixtureModelEM()
-
AlgorithmGaussianMixtureModelEM
public AlgorithmGaussianMixtureModelEM(int clusterMessageVerboseLevel, int init_num_of_subclasses, java.lang.String input_file_directory, java.lang.String input_file_name, java.lang.String parameter_output_file_directory, java.lang.String parameter_output_file_name, boolean full, int number_of_clusters)
-
AlgorithmGaussianMixtureModelEM
public AlgorithmGaussianMixtureModelEM(java.lang.String parameter_input_file_directory, java.lang.String parameter_input_file_name, java.lang.String file_directory, java.lang.String file_name, boolean classify)
-
-
Method Detail
-
demoClustFull
public void demoClustFull()
-
demoClustDiag
public void demoClustDiag()
-
demoClustFull5
public void demoClustFull5()
-
demoClustDiag5
public void demoClustDiag5()
-
demoClassify
public void demoClassify()
-
demoSplitClasses
public void demoSplitClasses()
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
clust
public void clust()
-
I_InitSigSet
private void I_InitSigSet(AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_SigSetNBands
private void I_SigSetNBands(AlgorithmGaussianMixtureModelEM.SigSet S, int nbands)
-
I_SetSigTitle
private void I_SetSigTitle(AlgorithmGaussianMixtureModelEM.SigSet S, java.lang.String title)
-
I_SetClassTitle
private void I_SetClassTitle(AlgorithmGaussianMixtureModelEM.ClassSig C, java.lang.String title)
-
I_NewClassSig
private AlgorithmGaussianMixtureModelEM.ClassSig I_NewClassSig(AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_NewSubSig
private AlgorithmGaussianMixtureModelEM.SubSig I_NewSubSig(AlgorithmGaussianMixtureModelEM.SigSet S, AlgorithmGaussianMixtureModelEM.ClassSig C)
-
I_AllocClassData
private AlgorithmGaussianMixtureModelEM.ClassData I_AllocClassData(AlgorithmGaussianMixtureModelEM.SigSet S, AlgorithmGaussianMixtureModelEM.ClassSig C, int npixels)
-
AverageVariance
private double AverageVariance(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands)
-
subcluster
private int subcluster(AlgorithmGaussianMixtureModelEM.SigSet S, int Class_Index, int desired_num, int option, double Rmin, int[] Max_num)
-
seed
private void seed(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands, double Rmin, int option)
-
DiagonalizeMatrix
private void DiagonalizeMatrix(double[][] R, int nbands)
-
compute_constants
private void compute_constants(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands)
-
clust_invert
private int clust_invert(double[][] a, int n, double[] det_man, int[] det_exp, int[] indx, double[][] y, double[] col)
-
ludcmp
private int ludcmp(double[][] a, int n, int[] indx, double[] d)
-
lubksb
private void lubksb(double[][] a, int[] indx, double[] b)
-
normalize_pi
private void normalize_pi(AlgorithmGaussianMixtureModelEM.ClassSig Sig)
-
refine_clusters
private double refine_clusters(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands, double Rmin, int option)
-
regroup
private double regroup(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands)
-
loglike
private double loglike(double[] x, AlgorithmGaussianMixtureModelEM.SubSig sSig, int nbands)
-
reestimate
private void reestimate(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands, double Rmin, int option)
-
save_ClassSig
private void save_ClassSig(AlgorithmGaussianMixtureModelEM.ClassSig Sig1, AlgorithmGaussianMixtureModelEM.SigSet S, int nbands)
-
copy_ClassSig
private void copy_ClassSig(AlgorithmGaussianMixtureModelEM.ClassSig Sig1, AlgorithmGaussianMixtureModelEM.ClassSig Sig2, int nbands)
-
copy_SubSig
private void copy_SubSig(AlgorithmGaussianMixtureModelEM.SubSig SubSig1, AlgorithmGaussianMixtureModelEM.SubSig SubSig2, int nbands)
-
reduce_order
private void reduce_order(AlgorithmGaussianMixtureModelEM.ClassSig Sig, int nbands, int[] min_ii, int[] min_jj)
-
distance
private double distance(AlgorithmGaussianMixtureModelEM.SubSig SubSig1, AlgorithmGaussianMixtureModelEM.SubSig SubSig2, int nbands)
-
add_SubSigs
private void add_SubSigs(AlgorithmGaussianMixtureModelEM.SubSig SubSig1, AlgorithmGaussianMixtureModelEM.SubSig SubSig2, AlgorithmGaussianMixtureModelEM.SubSig SubSig3, int nbands)
-
I_DeallocSubSig
private void I_DeallocSubSig(AlgorithmGaussianMixtureModelEM.ClassSig C)
-
I_DeallocSigSet
private void I_DeallocSigSet(AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_DeallocClassSig
private void I_DeallocClassSig(AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_DeallocClassData
private void I_DeallocClassData(AlgorithmGaussianMixtureModelEM.SigSet S, AlgorithmGaussianMixtureModelEM.ClassSig C)
-
I_WriteSigSet
private void I_WriteSigSet(java.io.RandomAccessFile raFile, AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_GetSigTitle
private java.lang.String I_GetSigTitle(AlgorithmGaussianMixtureModelEM.SigSet S)
-
I_GetClassTitle
private java.lang.String I_GetClassTitle(AlgorithmGaussianMixtureModelEM.ClassSig C)
-
classify
private void classify()
-
I_ReadSigSet
private void I_ReadSigSet(java.io.RandomAccessFile raFile, AlgorithmGaussianMixtureModelEM.SigSet S)
-
get_class
private void get_class(java.io.RandomAccessFile raFile, AlgorithmGaussianMixtureModelEM.SigSet S)
-
get_subclass
private void get_subclass(java.io.RandomAccessFile raFile, AlgorithmGaussianMixtureModelEM.SigSet S, AlgorithmGaussianMixtureModelEM.ClassSig C)
-
ClassLogLikelihood_init
private void ClassLogLikelihood_init(AlgorithmGaussianMixtureModelEM.SigSet S)
-
invert
private int invert(double[][] a, int n)
-
ClassLogLikelihood
private void ClassLogLikelihood(double[] vector, double[] ll, AlgorithmGaussianMixtureModelEM.SigSet S)
-
splitClasses
private void splitClasses()
-
-