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:
ActionListener,WindowListener,Runnable,EventListener
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatAn amplification factor greater than 1.0 causes this filter to act like a highpass filter.private booleanFlag, if true, indicates that the whole image should be processed.private float[]Storage location of the second derivative of the Gaussian in the X direction.private float[]Storage location of the second derivative of the Gaussian in the Y direction.private float[]Storage location of the second derivative of the Gaussian in the Z direction.private int[]Dimensionality of the kernel.private byte[]Buffer that stores the s value in calcInPlace2DBuffer that contributed to resultBuffer.private float[]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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmLapMedianess(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
Modifier and TypeMethodDescriptionfloat[]calcInBuffer2D(float[] buffer, int[] extents) Calculates the laplacian medianess of a 2D image and returns it as a float buffer.private voidcalcInPlace2D(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 voidCalculates 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 voidcalcStoreInDest2D(int nImages) This function produces the Laplacian of input image.private voidThis function produces the Laplacian of input image.voidfinalize()Prepares this class for destruction.byte[]DOCUMENT ME!private voidmakeKernels2D(float[] sigmas) Creates Gaussian derivative kernels.private voidmakeKernels3D(float[] sigmas) Creates Gaussian derivative kernels.voidStarts 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
amplificationFactor
private float amplificationFactorAn amplification factor greater than 1.0 causes this filter to act like a highpass filter. -
entireImage
private boolean entireImageFlag, if true, indicates that the whole image should be processed. If false on process the image over the mask areas. -
GxxData
private float[] GxxDataStorage location of the second derivative of the Gaussian in the X direction. -
GyyData
private float[] GyyDataStorage location of the second derivative of the Gaussian in the Y direction. -
GzzData
private float[] GzzDataStorage location of the second derivative of the Gaussian in the Z direction. -
kExtents
private int[] kExtentsDimensionality of the kernel. -
sBuffer
private byte[] sBufferBuffer that stores the s value in calcInPlace2DBuffer that contributed to resultBuffer. -
sigmas
private float[] sigmasStandard deviations of the gaussian used to calculate the kernels.
-
-
Constructor Details
-
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 Details
-
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:
finalizein classAlgorithmBase
-
getSBuffer
public byte[] getSBuffer()DOCUMENT ME!- Returns:
- sBuffer
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin 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!
-