Package gov.nih.mipav.model.algorithms
Class AlgorithmGraphBasedSegmentation
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmGraphBasedSegmentation
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmGraphBasedSegmentation extends AlgorithmBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classAlgorithmGraphBasedSegmentation.edgeprivate classAlgorithmGraphBasedSegmentation.edgeComparator(package private) classAlgorithmGraphBasedSegmentation.uni_elt(package private) classAlgorithmGraphBasedSegmentation.universe
-
Field Summary
Fields Modifier and Type Field Description private floatkprivate intminSizeprivate floatsigmaThe C++ source code for the port was downloaded from Pedro F.(package private) ViewUserInterfaceUIprivate intxDim-
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 AlgorithmGraphBasedSegmentation(ModelImage destImg, ModelImage srcImg, float sigma, float k, int minSize)Constructs graph based segmentation algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private floatdiff(float[] r, float[] g, float[] b, int x1, int y1, int x2, int y2)voidfinalize()Prepares this class for destruction.voidrunAlgorithm()Starts the program.(package private) AlgorithmGraphBasedSegmentation.universesegment_graph(int num_vertices, int num_edges, java.util.ArrayList<AlgorithmGraphBasedSegmentation.edge> edges, float k)-
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
-
sigma
private float sigma
The C++ source code for the port was downloaded from Pedro F. Felzenswalb's web page Graph Based Image Segmentation at http://cs.brown.edu/~pff/segment/ This code is ported with the permission of Pedro F. Felzenszwalb Reference: Pedro F. Felzenszwalb and Daniel P. Huttenlocher, International Journal of Computer Vision, 59(2), September, 2004. Port performed by William Gandler. This program takes a color image and produces a segmentation with a random color assigned to each region Typical parameters are: sigma = 0.5, k = 500, minSize = 20. Larger values for k result in larger components in the result.
-
k
private float k
-
minSize
private int minSize
-
xDim
private int xDim
-
UI
ViewUserInterface UI
-
-
Constructor Detail
-
AlgorithmGraphBasedSegmentation
public AlgorithmGraphBasedSegmentation(ModelImage destImg, ModelImage srcImg, float sigma, float k, int minSize)
Constructs graph based segmentation algorithm.- Parameters:
destImg- Image model where result image is to storedsrcImg- Source image modelsigma- Used to smooth the input image before segmenting itk- Value for the threshold functionminSize- Minimum component size enforced by post-processing
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
segment_graph
AlgorithmGraphBasedSegmentation.universe segment_graph(int num_vertices, int num_edges, java.util.ArrayList<AlgorithmGraphBasedSegmentation.edge> edges, float k)
-
diff
private float diff(float[] r, float[] g, float[] b, int x1, int y1, int x2, int y2)
-
-