Class AlgorithmWatershed

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

    public class AlgorithmWatershed
    extends AlgorithmBase
    This program applies the watershed algorithm to the image. It assumes that the user has identified the starting watershed regions via VOIs. Future work might be to develop a algorithm that automatically identifies initial seed points and regions or possibly an automatic method that forms watersheds - see method at end of file (does not work yet);
    Version:
    1.1 March 11, 1998
    Author:
    Matthew J. McAuliffe, Ph.D. and Ray Lert, MD
    • Field Detail

      • energyImage

        private ModelImage energyImage
        DOCUMENT ME!
      • sigmas

        private float[] sigmas
        DOCUMENT ME!
      • entireImage

        private boolean entireImage
        If true, ignore VOIs and process entire image
    • Constructor Detail

      • AlgorithmWatershed

        public AlgorithmWatershed​(ModelImage destImg,
                                  ModelImage srcImg,
                                  ModelImage gmImg,
                                  float[] sigmas,
                                  java.util.Vector<AlgorithmWatershed.Seed> seeds)
        Constructs new watershed algorithm.
        Parameters:
        destImg - Image model where result image is to stored
        srcImg - Source image model
        gmImg - Gradient magnitude image (can be null)
        sigmas - Gaussian's standard deviations in the each dimension
        seeds - Seed points for starting watershed
      • AlgorithmWatershed

        public AlgorithmWatershed​(ModelImage destImg,
                                  ModelImage srcImg,
                                  ModelImage gmImg,
                                  float[] sigmas,
                                  java.util.Vector<AlgorithmWatershed.Seed> seeds,
                                  boolean entireImage)
        Constructs new watershed algorithm.
        Parameters:
        destImg - Image model where result image is to stored
        srcImg - Source image model
        gmImg - Gradient magnitude image (can be null)
        sigmas - Gaussian's standard deviations in the each dimension
        seeds - Seed points for starting watershed
        entireImage - If true, ignore VOIs and process entire image
    • Method Detail

      • finalize

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

        public void setEnergyImage​(ModelImage _energyImage)
        This image is typically the gradient magnitude. Peaks in this image (function ) are the watersheds boundaries
        Parameters:
        _energyImage - the energy image (function)
      • setSeedVector

        public void setSeedVector​(WildMagic.LibFoundation.Mathematics.Vector3f[] seedPoints)
        Sets the seed vector.
        Parameters:
        seedPoints - The seed points.
      • calc2D

        private void calc2D()
        Calculates the watershed intialized by the VOI regions. The resultant watershed regions(basin) are labelled with an integer value. In addition, each region is separated by connected (8-way) watershed identifier of 1.
      • calc3D

        private void calc3D()
        Calculates the watershed intialized by the VOI regions. The resultant watershed regions(basin) are labelled with an integer value. In addition, each region is separated by connected (8-way) watershed identifier of 1.