Class HQueue


  • public class HQueue
    extends java.lang.Object
    This class is used specifically for the watershed algorithm. It is a version of Hierarcial Queue that greatly increases the speed of the watershed process.
    Version:
    0.1 Mar, 1998
    Author:
    Matthew J. McAuliffe, Ph.D., Ray Lert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float hmin
      DOCUMENT ME!
      private IntVector[] intVect
      DOCUMENT ME!
      private int MAX
      DOCUMENT ME!
      private int ptr
      DOCUMENT ME!
      private float slope
      DOCUMENT ME!
    • Constructor Summary

      Constructors 
      Constructor Description
      HQueue​(float hmin, float hmax, int MAX, int queueSize)
      Hierarcial Queue - constructor.
      HQueue​(float hmin, float hmax, int MAX, int[] imageHisto)
      Hierarcial Queue - constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int imgIndex, float GradImIn)
      add - adds a value to the queue.
      IntVector cloneElementsAt​(int i, int j)
      cloneElementsAt();
      void dispose()
      dispose - cleans up memory.
      int first()
      first - returns the last value in the first queue location that has image indexes in it.
      int firstAt​(int index)
      firstAt - removes and returns last element at a specific queue index.
      boolean isEmpty()
      isEmpty - returns a flag indicating if the entire hierarcial queue is empty.
      boolean isEmptyAt​(int index)
      isEmptyAt - returns a flag indicating if a specific queue is empty.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hmin

        private final float hmin
        DOCUMENT ME!
      • intVect

        private final IntVector[] intVect
        DOCUMENT ME!
      • MAX

        private final int MAX
        DOCUMENT ME!
      • ptr

        private int ptr
        DOCUMENT ME!
      • slope

        private final float slope
        DOCUMENT ME!
    • Constructor Detail

      • HQueue

        public HQueue​(float hmin,
                      float hmax,
                      int MAX,
                      int queueSize)
        Hierarcial Queue - constructor.
        Parameters:
        hmin - minimum value of data to be mapped into the queue
        hmax - maximum value of the queue to be mapped into the queue
        MAX - number of queue locations
        queueSize - used to initialize individual queue sizes.
      • HQueue

        public HQueue​(float hmin,
                      float hmax,
                      int MAX,
                      int[] imageHisto)
        Hierarcial Queue - constructor.
        Parameters:
        hmin - minimum value of data to be mapped into the queue
        hmax - maximum value of the queue to be mapped into the queue
        MAX - number of queue locations
        imageHisto - histogram of image used to set queue sizes
    • Method Detail

      • add

        public final void add​(int imgIndex,
                              float GradImIn)
        add - adds a value to the queue.
        Parameters:
        imgIndex - an index to a location in the image
        GradImIn - float value (gradient magnitude of the image at the location imgIndex;
      • cloneElementsAt

        public IntVector cloneElementsAt​(int i,
                                         int j)
        cloneElementsAt();
        Parameters:
        i - start index
        j - end index
        Returns:
        cloned integer vector beginning at i and ending at j
      • dispose

        public void dispose()
        dispose - cleans up memory.
      • first

        public final int first()
        first - returns the last value in the first queue location that has image indexes in it. (LIFO)
        Returns:
        DOCUMENT ME!
      • firstAt

        public int firstAt​(int index)
        firstAt - removes and returns last element at a specific queue index.
        Parameters:
        index - indicates a specific location in the queue return last value (image index) at a specific queue location
        Returns:
        DOCUMENT ME!
      • isEmpty

        public boolean isEmpty()
        isEmpty - returns a flag indicating if the entire hierarcial queue is empty.
        Returns:
        flag indicating if the entire queue structure is empty
      • isEmptyAt

        public boolean isEmptyAt​(int index)
        isEmptyAt - returns a flag indicating if a specific queue is empty.
        Parameters:
        index - location in the queue
        Returns:
        flag indicating if a queue location is empty