Class AlgorithmBoundaryAttenuation

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

    public class AlgorithmBoundaryAttenuation
    extends AlgorithmBase
    Attenuate around the boundary of an object defined by a VOI in an image volume.
    Author:
    Evan McCreedy
    • Field Detail

      • attenuationBuffer

        private float[] attenuationBuffer
        The attenuated VOI mask buffer.
      • kDimXY

        private int kDimXY
        The erosion kernel x and y dims.
      • kDimZ

        private int kDimZ
        The erosion kernel z dimension.
      • kernel

        private java.util.BitSet kernel
        The erosion kernel.
      • maskImage

        private ModelImage maskImage
        The mask image generated from the VOIs within the image.
      • maxAttenuation

        private float maxAttenuation
        The maximum amount of attenuation to perform (between 0 and 1).
      • numErosions

        private int numErosions
        The number of erosions to perform (and the number of levels of attenuation to do).
      • xDim

        private int xDim
        The image's x dimension.
      • xRes

        private float xRes
        The image's x resolution.
      • yDim

        private int yDim
        The image's y dimension.
      • zDim

        private int zDim
        The image's z dimension.
      • zRes

        private float zRes
        The image's z resolution.
    • Constructor Detail

      • AlgorithmBoundaryAttenuation

        public AlgorithmBoundaryAttenuation​(ModelImage srcImg,
                                            int numErosions,
                                            float maxAttenuation)
        Set up the algorithm. Extract a mask to use in the attenuation using VOIs within the image and set up the kernel.
        Parameters:
        srcImg - the image to attenuate (must have a VOI in it to define the area to attenuate)
        numErosions - the number of erosions to do
        maxAttenuation - the maximum amount to reduce the object intensity by (0,1)
    • Method Detail

      • finalize

        public void finalize()
        Clean up memory used by the algorithm.
        Overrides:
        finalize in class AlgorithmBase
      • getResultImage

        public ModelImage getResultImage()
        Return the attenuated image.
        Returns:
        the attenuated image
      • erode

        private void erode​(ModelImage img,
                           int iterations)
        Erode an image and mark the pixels we erode for attenuation later.
        Parameters:
        img - the image to erode
        iterations - the number of erosions to perform
      • makeKernel

        private void makeKernel​(int kernelType)
        Generates a kernel of the indicated type.
        Parameters:
        kernelType - type of kernel to be generated