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

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 Details

    • 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 Details

    • AlgorithmLapMedianess

      public AlgorithmLapMedianess(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean img25D, float ampFactor)
      Constructs a Laplacian algorithm object.
      Parameters:
      srcImg - source image model
      sigmas - Gaussian's standard deviations in the each dimension
      maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
      img25D - 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 model
      sigmas - Gaussian's standard deviations in the each dimension
      maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
      img25D - 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 stored
      srcImg - source image model
      sigmas - Gaussian's standard deviations in the each dimension
      maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
      img25D - 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 stored
      srcImg - source image model
      sigmas - Gaussian's standard deviations in the each dimension
      maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
      img25D - 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:
      finalize in class AlgorithmBase
    • getSBuffer

      public byte[] getSBuffer()
      DOCUMENT ME!
      Returns:
      sBuffer
    • runAlgorithm

      public void runAlgorithm()
      Starts the program.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • 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!