br.usp.ime.klava.segmentit.structures
Class PrimitiveCatchmentBasin

java.lang.Object
  extended by br.usp.ime.klava.segmentit.structures.PrimitiveCatchmentBasin

public class PrimitiveCatchmentBasin
extends java.lang.Object

Represents an atomic unit of partitions, associated to a regional minimum of an image.

Author:
Bruno Klava

Constructor Summary
PrimitiveCatchmentBasin(int label)
          Constructs a PrimitiveCatchmentBasin.
 
Method Summary
 void addPixel(Pixel pixel)
          Adds pixel to this PrimitiveCatchmentBasin.
 int[] getHistogram()
          Returns the histogram of the gray levels of the Pixels in this PrimitiveCatchmentBasin.
 int getLabel()
          Returns the label of this PrimitiveCatchmentBasin.
 int getMinimumLevel()
          Returns the minimum gray level in this PrimitiveCatchmentBasin.
 java.awt.geom.Point2D.Double getMinimumVisualization()
          Returns a double precision point located at the center of a pixel of the regional minimum of this PrimitiveCatchmentBasin for visualization purposes.
 int getNumPixels()
          Returns the number of Pixels that belongs to this PrimitiveCatchmentBasin.
 java.util.List<Pixel> getPixels()
          Returns a List with the Pixels that belongs to this PrimitiveCatchmentBasin.
 Pixel getRegionalMinimumPixel()
          Returns a Pixel of this PrimitiveCatchmentBasin regional minimum.
 void paint(java.awt.image.BufferedImage image, java.awt.Color color)
          Paints this PrimitiveCatchmentBasin with the given color .
 Pixel paintPathFromMinimumToPixel(Pixel pixel, java.awt.image.BufferedImage image, java.awt.Color color)
          Paints a path from the given pixel to the regional minimum of this PrimitiveCatchmentBasin.
 void paintRegionalMinimum(java.awt.image.BufferedImage image, java.awt.Color color)
          Paints the regional minimum of this PrimitiveCatchmentBasin.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveCatchmentBasin

public PrimitiveCatchmentBasin(int label)
Constructs a PrimitiveCatchmentBasin.

Parameters:
label - the label of this PrimitiveCatchmentBasin
Method Detail

getLabel

public int getLabel()
Returns the label of this PrimitiveCatchmentBasin.

Returns:
the label of this PrimitiveCatchmentBasin

getHistogram

public int[] getHistogram()
Returns the histogram of the gray levels of the Pixels in this PrimitiveCatchmentBasin.

Returns:
the histogram of the gray levels of the Pixels in this PrimitiveCatchmentBasin

getMinimumLevel

public int getMinimumLevel()
Returns the minimum gray level in this PrimitiveCatchmentBasin.

Returns:
the minimum gray level in this PrimitiveCatchmentBasin

addPixel

public void addPixel(Pixel pixel)
Adds pixel to this PrimitiveCatchmentBasin.

Parameters:
pixel - the Pixel to be added to this PrimitiveCatchmentBasin

getMinimumVisualization

public java.awt.geom.Point2D.Double getMinimumVisualization()
Returns a double precision point located at the center of a pixel of the regional minimum of this PrimitiveCatchmentBasin for visualization purposes.

Returns:
a point located at the center of a pixel of the regional minimum of this PrimitiveCatchmentBasin for visualization purposes

getNumPixels

public int getNumPixels()
Returns the number of Pixels that belongs to this PrimitiveCatchmentBasin.

Returns:
the number of Pixels that belongs to this PrimitiveCatchmentBasin

getPixels

public java.util.List<Pixel> getPixels()
Returns a List with the Pixels that belongs to this PrimitiveCatchmentBasin.

Returns:
a List with the Pixels that belongs to this PrimitiveCatchmentBasin

paint

public void paint(java.awt.image.BufferedImage image,
                  java.awt.Color color)
Paints this PrimitiveCatchmentBasin with the given color .

Parameters:
image - the image where this PrimitiveCatchmentBasin will be painted
color - the Color to be used to paint this PrimitiveCatchmentBasin

paintRegionalMinimum

public void paintRegionalMinimum(java.awt.image.BufferedImage image,
                                 java.awt.Color color)
Paints the regional minimum of this PrimitiveCatchmentBasin.

Parameters:
image - the image where the regional minimum of this PrimitiveCatchmentBasin will be painted
color - the Color to be used to paint the regional minimum

getRegionalMinimumPixel

public Pixel getRegionalMinimumPixel()
Returns a Pixel of this PrimitiveCatchmentBasin regional minimum.

Returns:
a Pixel of this PrimitiveCatchmentBasin regional minimum

paintPathFromMinimumToPixel

public Pixel paintPathFromMinimumToPixel(Pixel pixel,
                                         java.awt.image.BufferedImage image,
                                         java.awt.Color color)
Paints a path from the given pixel to the regional minimum of this PrimitiveCatchmentBasin.

Parameters:
pixel - the origin of the path
image - the image where the path will be painted
color - the Color to be used to paint the path
Returns:
the Pixel of the regional minimum that is the end of the painted path