Class AlgorithmWatershed

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmWatershed
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, 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 Details

    • BOUNDARY

      private static final short BOUNDARY
      DOCUMENT ME!
      See Also:
    • MASK

      private static final short MASK
      DOCUMENT ME!
      See Also:
    • INITIAL

      private static final short INITIAL
      DOCUMENT ME!
      See Also:
    • WSHED

      private static final short WSHED
      DOCUMENT ME!
      See Also:
    • energyImage

      private ModelImage energyImage
      DOCUMENT ME!
    • seedVector

      private Vector<AlgorithmWatershed.Seed> seedVector
      DOCUMENT ME!
    • sigmas

      private float[] sigmas
      DOCUMENT ME!
    • entireImage

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

    • AlgorithmWatershed

      public AlgorithmWatershed(ModelImage destImg, ModelImage srcImg, ModelImage gmImg, float[] sigmas, 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, 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 Details

    • finalize

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

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