Package gov.nih.mipav.model.algorithms
Class AlgorithmLapMedianess
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmLapMedianess
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmLapMedianess extends AlgorithmBase
Calculates the Laplacian of the gaussian of an image at a scale defined by the user.- Version:
- 0.1 Feb 11, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
-
-
Field Summary
Fields Modifier and Type Field Description private float
amplificationFactor
An amplification factor greater than 1.0 causes this filter to act like a highpass filter.private boolean
entireImage
Flag, if true, indicates that the whole image should be processed.private float[]
GxxData
Storage location of the second derivative of the Gaussian in the X direction.private float[]
GyyData
Storage location of the second derivative of the Gaussian in the Y direction.private float[]
GzzData
Storage location of the second derivative of the Gaussian in the Z direction.private int[]
kExtents
Dimensionality of the kernel.private byte[]
sBuffer
Buffer that stores the s value in calcInPlace2DBuffer that contributed to resultBuffer.private float[]
sigmas
Standard deviations of the gaussian used to calculate the kernels.-
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 AlgorithmLapMedianess(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor)
Constructs a Laplacian algorithm object.AlgorithmLapMedianess(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor, boolean activeImage)
Constructs a Laplacian algorithm object.AlgorithmLapMedianess(ModelImage destImg, ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor)
Constructs a Laplacian algorithm object.AlgorithmLapMedianess(ModelImage destImg, ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor, boolean activeImage)
Constructs a Laplacian algorithm object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]
calcInBuffer2D(float[] buffer, int[] extents)
Calculates the laplacian medianess of a 2D image and returns it as a float buffer.private void
calcInPlace2D(int nImages)
Calculates the gradient image and replaces the source image with the new image.private float[]
calcInPlace2DBuffer(int nImages, float[] buffer, int[] extents)
Calculates the Laplacian image and replaces the source image with the new image.private void
calcInPlace3D()
Calculates the Laplacian and replaces the source image with the new image.private float[]
calcInPlace3DBuffer(float[] buffer, int[] extents)
Calculates the Laplacian image and replaces the source image with the new image.private void
calcStoreInDest2D(int nImages)
This function produces the Laplacian of input image.private void
calcStoreInDest3D()
This function produces the Laplacian of input image.void
finalize()
Prepares this class for destruction.byte[]
getSBuffer()
DOCUMENT ME!private void
makeKernels2D(float[] sigmas)
Creates Gaussian derivative kernels.private void
makeKernels3D(float[] sigmas)
Creates Gaussian derivative kernels.void
runAlgorithm()
Starts the program.-
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
-
amplificationFactor
private float amplificationFactor
An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
-
entireImage
private boolean entireImage
Flag, if true, indicates that the whole image should be processed. If false on process the image over the mask areas.
-
GxxData
private float[] GxxData
Storage location of the second derivative of the Gaussian in the X direction.
-
GyyData
private float[] GyyData
Storage location of the second derivative of the Gaussian in the Y direction.
-
GzzData
private float[] GzzData
Storage location of the second derivative of the Gaussian in the Z direction.
-
kExtents
private int[] kExtents
Dimensionality of the kernel.
-
sBuffer
private byte[] sBuffer
Buffer that stores the s value in calcInPlace2DBuffer that contributed to resultBuffer.
-
sigmas
private float[] sigmas
Standard deviations of the gaussian used to calculate the kernels.
-
-
Constructor Detail
-
AlgorithmLapMedianess
public AlgorithmLapMedianess(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor)
Constructs a Laplacian algorithm object.- Parameters:
srcImg
- source image modelsigmas
- Gaussian's standard deviations in the each dimensionmaskFlag
- Flag that indicates that the Laplacian will be calculated for the whole image if equal to trueimg25D
- Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.ampFactor
- An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
-
AlgorithmLapMedianess
public AlgorithmLapMedianess(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor, boolean activeImage)
Constructs a Laplacian algorithm object.- Parameters:
srcImg
- source image modelsigmas
- Gaussian's standard deviations in the each dimensionmaskFlag
- Flag that indicates that the Laplacian will be calculated for the whole image if equal to trueimg25D
- Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.ampFactor
- An amplification factor greater than 1.0 causes this filter to act like a highpass filter.runningInSeparateThread
- whether the algorithm is running in a separate thread
-
AlgorithmLapMedianess
public AlgorithmLapMedianess(ModelImage destImg, ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor)
Constructs a Laplacian algorithm object.- Parameters:
destImg
- image model where result image is to storedsrcImg
- source image modelsigmas
- Gaussian's standard deviations in the each dimensionmaskFlag
- Flag that indicates that the Laplacian will be calculated for the whole image if equal to trueimg25D
- Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.ampFactor
- An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
-
AlgorithmLapMedianess
public AlgorithmLapMedianess(ModelImage destImg, ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor, boolean activeImage)
Constructs a Laplacian algorithm object.- Parameters:
destImg
- image model where result image is to storedsrcImg
- source image modelsigmas
- Gaussian's standard deviations in the each dimensionmaskFlag
- Flag that indicates that the Laplacian will be calculated for the whole image if equal to trueimg25D
- Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.ampFactor
- An amplification factor greater than 1.0 causes this filter to act like a highpass filter.runningInSeparateThread
- whether the algorithm is running in a separate thread
-
-
Method Detail
-
calcInBuffer2D
public float[] calcInBuffer2D(float[] buffer, int[] extents)
Calculates the laplacian medianess of a 2D image and returns it as a float buffer.- Parameters:
buffer
- DOCUMENT ME!extents
- DOCUMENT ME!- Returns:
- Buffer with the laplacian medianess of the image.
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getSBuffer
public byte[] getSBuffer()
DOCUMENT ME!- Returns:
- sBuffer
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcInPlace2D
private void calcInPlace2D(int nImages)
Calculates the gradient image and replaces the source image with the new image.- Parameters:
nImages
- number of images to be blurred. If 2D image then nImage = 1, if 3D image where each image is to processed independently then nImages equals the number of images in the volume.
-
calcInPlace2DBuffer
private float[] calcInPlace2DBuffer(int nImages, float[] buffer, int[] extents)
Calculates the Laplacian image and replaces the source image with the new image.- Parameters:
nImages
- number of images to be blurred. If 2D image then nImage = 1, if 3D image where each image is to processed independently then nImages equals the number of images in the volume.buffer
- DOCUMENT ME!extents
- DOCUMENT ME!- Returns:
- resultBuffer
-
calcInPlace3D
private void calcInPlace3D()
Calculates the Laplacian and replaces the source image with the new image.
-
calcInPlace3DBuffer
private float[] calcInPlace3DBuffer(float[] buffer, int[] extents)
Calculates the Laplacian image and replaces the source image with the new image.- Parameters:
buffer
- DOCUMENT ME!extents
- DOCUMENT ME!- Returns:
- resultBuffer
-
calcStoreInDest2D
private void calcStoreInDest2D(int nImages)
This function produces the Laplacian of input image. See this Neva- Parameters:
nImages
- number of images to be blurred. If 2D image then nImage = 1, if 3D image where each image is to processed independently then nImages equals the number of images in the volume.
-
calcStoreInDest3D
private void calcStoreInDest3D()
This function produces the Laplacian of input image.
-
makeKernels2D
private void makeKernels2D(float[] sigmas)
Creates Gaussian derivative kernels.- Parameters:
sigmas
- DOCUMENT ME!
-
makeKernels3D
private void makeKernels3D(float[] sigmas)
Creates Gaussian derivative kernels.- Parameters:
sigmas
- DOCUMENT ME!
-
-