Class AlgorithmUnsharpMask

  • All Implemented Interfaces:
    AlgorithmInterface, java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmUnsharpMask
    extends AlgorithmBase
    implements AlgorithmInterface
    Calculates the Unsharp Mask of an image at a scale defined by the user ( unsharp image = original image - weight * blurred image); weight < 1;
    Version:
    1.0 Feb 11, 2000
    Author:
    Matthew J. McAuliffe, Ph.D.
    • Field Detail

      • entireImage

        private boolean entireImage
        DOCUMENT ME!
      • gaussData

        private float[] gaussData
        DOCUMENT ME!
      • kExtents

        private int[] kExtents
        DOCUMENT ME!
      • sigmas

        private float[] sigmas
        DOCUMENT ME!
      • weightA

        private double weightA
      • outputBuffer

        private float[] outputBuffer
      • cubic

        private boolean cubic
      • maximumCorrection

        private double maximumCorrection
    • Constructor Detail

      • AlgorithmUnsharpMask

        public AlgorithmUnsharpMask​(ModelImage srcImg,
                                    float[] sigmas,
                                    double weight,
                                    boolean maskFlag,
                                    boolean img25D,
                                    boolean cubic,
                                    double maximumCorrection)
        Constructor.
        Parameters:
        srcImg - source image model
        sigmas - Gaussian's standard deviations in the each dimension
        weight - weighting factor, should be less than 1
        maskFlag - Flag that indicates that the unsharp mask 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.
        cubic - If true use nonlinear cubic filter
        maximumCorrection - absolute value of maximum correction allowed in cubic algorithm
      • AlgorithmUnsharpMask

        public AlgorithmUnsharpMask​(ModelImage destImg,
                                    ModelImage srcImg,
                                    float[] sigmas,
                                    double weight,
                                    boolean maskFlag,
                                    boolean img25D,
                                    boolean cubic,
                                    double maximumCorrection)
        Constructor.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        sigmas - Gaussian's standard deviations in the each dimension
        weight - weighting factor, should be less than 1
        maskFlag - Flag that indicates that the unsharp mask 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.
        cubic - If true use nonlinear cubic filter
        maximumCorrection - absolute value of maximum correction allowed in cubic algorithm
    • Method Detail

      • finalize

        public void finalize()
        prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • runCubicAlgorithm

        private void runCubicAlgorithm()
      • calcInPlace2D

        private void calcInPlace2D​(int nImages)
        calculates the blurred image and replaces the source image with the blurred image.
        Parameters:
        nImages - number of images to be processed. 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.
      • calcInPlace3D

        private void calcInPlace3D()
        calculates the UnsharpMask and replaces the source image with the new image.
      • calcStoreInDest2D

        private void calcStoreInDest2D​(int nImages)
        this function produces a new image that has been blurred.
        Parameters:
        nImages - number of images to be processed. 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 UnsharpMask of input image.
      • makeKernels2D

        private void makeKernels2D()
        creates Gaussian kernels for the blurring process.
      • makeKernels3D

        private void makeKernels3D()
        creates Gaussian kernels for the blurring process.
      • 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 interface AlgorithmInterface
        Parameters:
        algorithm - the algorithm which has just completed