Class AlgorithmMorphologicalFilter

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

    public class AlgorithmMorphologicalFilter
    extends AlgorithmBase
    Performs morphological filtering on black and white images. This is a shading correction routine, that is, it corrects for non-uniform illumination and non-uniform camera sensitivity. A morphological filtered pixel = the original pixel - the morphological smoothed pixel + a constant to restore the original average image brightness. A morphological smoothed pixel is given by the min(max(max(min(original pixel)))), where the sizes[] array contains the dimensions of the region examined for the minimum and the maximum. Reference: 1.) "Shading Correction: Compensation for Illumination and Sensor Inhomogeneities" by Ian T. Young, July 19, 2000. www.ph.tn.tudelft.nl/People/albert/papers/YoungShading.pdf
    Version:
    0.1 Feb 17, 2005
    Author:
    William Gandler
    • Field Detail

      • 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.
      • sizes

        private int[] sizes
        Kernel dimensionality.
      • xDim

        private int xDim
        DOCUMENT ME!
      • yDim

        private int yDim
        DOCUMENT ME!
      • zDim

        private int zDim
        DOCUMENT ME!
    • Constructor Detail

      • AlgorithmMorphologicalFilter

        public AlgorithmMorphologicalFilter​(ModelImage srcImg,
                                            int[] sizes,
                                            boolean maskFlag,
                                            boolean img25D)
        Constructs a Morphological filter object.
        Parameters:
        srcImg - source image model
        sizes - Filter size in each dimension
        maskFlag - Flag that indicates that the Morphological filter 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.
      • AlgorithmMorphologicalFilter

        public AlgorithmMorphologicalFilter​(ModelImage destImg,
                                            ModelImage srcImg,
                                            int[] sizes,
                                            boolean maskFlag,
                                            boolean img25D)
        Constructs a Morphological filter object.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        sizes - Filter size in each dimension
        maskFlag - Flag that indicates that the Morphological filter 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.
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • calcInPlace2D

        private void calcInPlace2D​(int nImages)
        Calculates the Morphological Filter 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.
      • calcInPlace3D

        private void calcInPlace3D()
        Calculates the Morphological Filter and replaces the source image with the new image.
      • calcStoreInDest2D

        private void calcStoreInDest2D​(int nImages)
        This function produces the Morphological Filter of input 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.
      • calcStoreInDest3D

        private void calcStoreInDest3D()
        This function produces the Morphological Filter of input image.
      • max2DPt

        private float max2DPt​(int pix,
                              float[] image)
        A function that finds the maximum value in a local image rectangle.
        Parameters:
        pix - index indicating location of convolution
        image - image data
        Returns:
        DOCUMENT ME!
      • max3DPt

        private float max3DPt​(int pix,
                              float[] image)
        A function that finds the maximum value in a local image volume.
        Parameters:
        pix - index indicating location of convolution
        image - image data
        Returns:
        DOCUMENT ME!
      • min2DPt

        private float min2DPt​(int pix,
                              float[] image)
        A function that finds the minimum value in a local image rectangle.
        Parameters:
        pix - index indicating location of convolution
        image - image data
        Returns:
        DOCUMENT ME!
      • min3DPt

        private float min3DPt​(int pix,
                              float[] image)
        A function that finds the minimum value in a local image volume.
        Parameters:
        pix - index indicating location of convolution
        image - image data
        Returns:
        DOCUMENT ME!