Package gov.nih.mipav.model.algorithms
Class DBSCANClusteringSegment
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.DBSCANClusteringSegment
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class DBSCANClusteringSegment extends AlgorithmBase
% Copyright (c) 2013 Peter Kovesi % www.peterkovesi.com/matlabfns/ % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal % in the Software without restriction, subject to the following conditions: % % The above copyright notice and this permission notice shall be included in % all copies or substantial portions of the Software. % % The Software is provided "as is", without warranty of any kind. The image must be a color image First the slic.m software performs a SLIC Simple Linear Iterative Clustering SuperPixels. SLIC is followed by SPDBSCAN.m to perform a DBSCAN clustering of superpixels. This results in a simple and fast segmentation of an image. Ported MATLAB files: slic.m Implementation of Achanta, Shaji, Smith, Lucchi, Fua and Susstrunk's SLIC Superpixels. spdbscan.m Implements DBSCAN clustering of superpixels. mcleanupregions.m Morphological version of cleanupregions.m The output is not quite as nice but the execution is much faster. finddisconnected.m Finds groupings of disconnected labeled regions. Used by mcleanupregions.m to reduce execution time. makeregionsdistinct.m Ensures labeled regions are distinct. renumberregions.m Ensures all regions in labeled image have a unique label and that the label numbering forms a contiguous sequence. regionadjacency.m Computes adjacency matrix for an image of labeled segmented regions. References: R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua and S. Susstrunk. "SLIC Superpixels Compared to State-of-the-Art Superpixel Methods" PAMI. Vol 34 No 11. November 2012. pp 2274-2281. Martin Ester, Hans-Peter Kriegel, Jorg Sander, Xiaowei Xu (1996). "A density-based algorithm for discovering clusters in large spatial databases with noise". Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD-96). AAAI Press. pp. 226-231.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
DBSCANClusteringSegment.AmAl
(package private) class
DBSCANClusteringSegment.Renum
(package private) class
DBSCANClusteringSegment.SP
-
Field Summary
Fields Modifier and Type Field Description private int
center
private double
Ec
private int
k
private double
m
private int
MEAN_CENTER
private int
MEDIAN_CENTER
private int
mw1
private int
mw2
private int
nItr
private double
seRadius
-
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 DBSCANClusteringSegment(ModelImage destImg, ModelImage srcImg, int k, double m, double seRadius, int center, int mw1, int mw2, int nItr, double Ec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
bwlabel4(int[][] bl)
private double[][]
dist(double[] C, double[][][] im, int r1, int c1, double S, double m)
private java.util.Vector<java.util.Vector<java.lang.Integer>>
finddisconnected(int[][] l)
private int
makeregionsdistinct(int[][] seg, int connectivity)
private DBSCANClusteringSegment.AmAl
mcleanupregions(int[][] seg, double seRadius)
private DBSCANClusteringSegment.AmAl
regionadjacency(int[][] L, int connectivity)
private java.util.Vector<java.lang.Integer>
regionQueryM(DBSCANClusteringSegment.SP Sp, DBSCANClusteringSegment.AmAl amal, int n, double Ec)
private DBSCANClusteringSegment.Renum
renumberregions(int[][] L)
void
runAlgorithm()
Actually runs the algorithm.-
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
-
MEAN_CENTER
private final int MEAN_CENTER
- See Also:
- Constant Field Values
-
MEDIAN_CENTER
private final int MEDIAN_CENTER
- See Also:
- Constant Field Values
-
k
private int k
-
m
private double m
-
seRadius
private double seRadius
-
center
private int center
-
mw1
private int mw1
-
mw2
private int mw2
-
nItr
private int nItr
-
Ec
private double Ec
-
-
Constructor Detail
-
DBSCANClusteringSegment
public DBSCANClusteringSegment(ModelImage destImg, ModelImage srcImg, int k, double m, double seRadius, int center, int mw1, int mw2, int nItr, double Ec)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
regionQueryM
private java.util.Vector<java.lang.Integer> regionQueryM(DBSCANClusteringSegment.SP Sp, DBSCANClusteringSegment.AmAl amal, int n, double Ec)
-
mcleanupregions
private DBSCANClusteringSegment.AmAl mcleanupregions(int[][] seg, double seRadius)
-
renumberregions
private DBSCANClusteringSegment.Renum renumberregions(int[][] L)
-
finddisconnected
private java.util.Vector<java.util.Vector<java.lang.Integer>> finddisconnected(int[][] l)
-
regionadjacency
private DBSCANClusteringSegment.AmAl regionadjacency(int[][] L, int connectivity)
-
makeregionsdistinct
private int makeregionsdistinct(int[][] seg, int connectivity)
-
bwlabel4
private int bwlabel4(int[][] bl)
-
dist
private double[][] dist(double[] C, double[][][] im, int r1, int c1, double S, double m)
-
-