Package gov.nih.mipav.model.structures
Class HQueue
- java.lang.Object
-
- gov.nih.mipav.model.structures.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
-
-
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.
-
-
-
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 queuehmax
- maximum value of the queue to be mapped into the queueMAX
- number of queue locationsqueueSize
- 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 queuehmax
- maximum value of the queue to be mapped into the queueMAX
- number of queue locationsimageHisto
- 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 imageGradImIn
- float value (gradient magnitude of the image at the location imgIndex;
-
cloneElementsAt
public IntVector cloneElementsAt(int i, int j)
cloneElementsAt();- Parameters:
i
- start indexj
- 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
-
-