Package gov.nih.mipav.model.algorithms
Class AlgorithmTextureSegmentation
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmTextureSegmentation
-
- All Implemented Interfaces:
AlgorithmInterface
,java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmTextureSegmentation extends AlgorithmBase implements AlgorithmInterface
This software implements the factorization-based segmentation algorithm. The original code was written in MATLAB and C by: Jiangye Yuan Computational Sciences and and Engineering Division Oak Ridge National Laboratory, Oak Ridge, Tennessee 37831 yuanj@ornl.gov Reference: [1] J. Yuan and D. L. Wang. Factorization-based texture segmentation. Technical Report OSU-CISRC-1/13 -TR01, 2013. The website for this code is: https://sites.google.com/site/factorizationsegmentation/ This code was ported to Java by William Gandler
-
-
Field Summary
Fields Modifier and Type Field Description private int
binNumber
private java.util.BitSet
contourMask
private double[]
filter
private int
filterNumber
private static int
filterOp
private boolean
nonNegativity
private double
omega
private int
operationType
private WildMagic.LibFoundation.Mathematics.Vector3f[]
pt
private boolean
removeSmallRegions
private int
segmentNumber
private int
windowSize
private int
xDim
private int
yDim
-
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 AlgorithmTextureSegmentation(ModelImage destImage, ModelImage srcImage, int windowSize, int segmentNumber, WildMagic.LibFoundation.Mathematics.Vector3f[] pt, java.util.BitSet contourMask, boolean nonNegativity, boolean removeSmallRegions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
algorithmPerformed(AlgorithmBase algorithm)
Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).private void
expand(int y, int x, int[] stk, int[][] segLabelLarge, int[][] segLabel, int labelN, int[] cnt, int[] tb, int[] bb, int[] lb, int[] rb, int tgt)
private void
expand2(int y, int x, int[] stk, int[] mark, int[][] segLabel, int labelN, int[] cnt, int[] tb, int[] bb, int[] lb, int[] rb, int tgt)
private double
l2dist(double[] a, double[] b, int k)
private void
RmSmRg(int[][] segLabelLarge, int[][] segLabel, int minSize)
void
runAlgorithm()
Actually runs the algorithm.private void
SHcomp(double[][][] sh_mx, int ws, double[][][] Ig)
private void
SHedge_ls(double[][] EdgeMap, int ws, int dism, double[][][] sh_mx)
private double
x2dist(double[] a, double[] b, int k)
-
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
-
filterOp
private static final int filterOp
- See Also:
- Constant Field Values
-
operationType
private int operationType
-
filter
private double[] filter
-
windowSize
private int windowSize
-
segmentNumber
private int segmentNumber
-
pt
private WildMagic.LibFoundation.Mathematics.Vector3f[] pt
-
contourMask
private java.util.BitSet contourMask
-
nonNegativity
private boolean nonNegativity
-
removeSmallRegions
private boolean removeSmallRegions
-
omega
private double omega
-
filterNumber
private int filterNumber
-
binNumber
private int binNumber
-
xDim
private int xDim
-
yDim
private int yDim
-
-
Constructor Detail
-
AlgorithmTextureSegmentation
public AlgorithmTextureSegmentation(ModelImage destImage, ModelImage srcImage, int windowSize, int segmentNumber, WildMagic.LibFoundation.Mathematics.Vector3f[] pt, java.util.BitSet contourMask, boolean nonNegativity, boolean removeSmallRegions)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
RmSmRg
private void RmSmRg(int[][] segLabelLarge, int[][] segLabel, int minSize)
-
expand
private void expand(int y, int x, int[] stk, int[][] segLabelLarge, int[][] segLabel, int labelN, int[] cnt, int[] tb, int[] bb, int[] lb, int[] rb, int tgt)
-
expand2
private void expand2(int y, int x, int[] stk, int[] mark, int[][] segLabel, int labelN, int[] cnt, int[] tb, int[] bb, int[] lb, int[] rb, int tgt)
-
SHedge_ls
private void SHedge_ls(double[][] EdgeMap, int ws, int dism, double[][][] sh_mx)
-
x2dist
private double x2dist(double[] a, double[] b, int k)
-
l2dist
private double l2dist(double[] a, double[] b, int k)
-
SHcomp
private void SHcomp(double[][][] sh_mx, int ws, double[][][] Ig)
-
algorithmPerformed
public void algorithmPerformed(AlgorithmBase algorithm)
Description copied from interface:AlgorithmInterface
Called after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformed
in interfaceAlgorithmInterface
- Parameters:
algorithm
- the algorithm which has just completed
-
-