Class AlgorithmBoundaryAttenuation
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmBoundaryAttenuation
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmBoundaryAttenuation extends AlgorithmBase
Attenuate around the boundary of an object defined by a VOI in an image volume.- Author:
- Evan McCreedy
-
-
Field Summary
Fields Modifier and Type Field Description private float[]
attenuationBuffer
The attenuated VOI mask buffer.private int
kDimXY
The erosion kernel x and y dims.private int
kDimZ
The erosion kernel z dimension.private java.util.BitSet
kernel
The erosion kernel.private ModelImage
maskImage
The mask image generated from the VOIs within the image.private float
maxAttenuation
The maximum amount of attenuation to perform (between 0 and 1).private int
numErosions
The number of erosions to perform (and the number of levels of attenuation to do).private int
xDim
The image's x dimension.private float
xRes
The image's x resolution.private int
yDim
The image's y dimension.private int
zDim
The image's z dimension.private float
zRes
The image's z resolution.-
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 AlgorithmBoundaryAttenuation(ModelImage srcImg, int numErosions, float maxAttenuation)
Set up the algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
erode(ModelImage img, int iterations)
Erode an image and mark the pixels we erode for attenuation later.void
finalize()
Clean up memory used by the algorithm.ModelImage
getResultImage()
Return the attenuated image.private void
makeKernel(int kernelType)
Generates a kernel of the indicated type.void
runAlgorithm()
Start the algorithm.-
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
-
attenuationBuffer
private float[] attenuationBuffer
The attenuated VOI mask buffer.
-
kDimXY
private int kDimXY
The erosion kernel x and y dims.
-
kDimZ
private int kDimZ
The erosion kernel z dimension.
-
kernel
private java.util.BitSet kernel
The erosion kernel.
-
maskImage
private ModelImage maskImage
The mask image generated from the VOIs within the image.
-
maxAttenuation
private float maxAttenuation
The maximum amount of attenuation to perform (between 0 and 1).
-
numErosions
private int numErosions
The number of erosions to perform (and the number of levels of attenuation to do).
-
xDim
private int xDim
The image's x dimension.
-
xRes
private float xRes
The image's x resolution.
-
yDim
private int yDim
The image's y dimension.
-
zDim
private int zDim
The image's z dimension.
-
zRes
private float zRes
The image's z resolution.
-
-
Constructor Detail
-
AlgorithmBoundaryAttenuation
public AlgorithmBoundaryAttenuation(ModelImage srcImg, int numErosions, float maxAttenuation)
Set up the algorithm. Extract a mask to use in the attenuation using VOIs within the image and set up the kernel.- Parameters:
srcImg
- the image to attenuate (must have a VOI in it to define the area to attenuate)numErosions
- the number of erosions to domaxAttenuation
- the maximum amount to reduce the object intensity by (0,1)
-
-
Method Detail
-
finalize
public void finalize()
Clean up memory used by the algorithm.- Overrides:
finalize
in classAlgorithmBase
-
getResultImage
public ModelImage getResultImage()
Return the attenuated image.- Returns:
- the attenuated image
-
runAlgorithm
public void runAlgorithm()
Start the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
erode
private void erode(ModelImage img, int iterations)
Erode an image and mark the pixels we erode for attenuation later.- Parameters:
img
- the image to erodeiterations
- the number of erosions to perform
-
makeKernel
private void makeKernel(int kernelType)
Generates a kernel of the indicated type.- Parameters:
kernelType
- type of kernel to be generated
-
-