util.wavelet
Class Structure

java.lang.Object
  extended by util.wavelet.Structure
All Implemented Interfaces:
Comparable

public class Structure
extends Object
implements Comparable

Set of contiguous wavelet coefficients which exceed a noise threshold. A structure is defined in a scale with a noise threshold. A structure optionally contains a reference to its parent structure and a list children structures via interscale relationships. A Structure may be a part of a WObject. A Structure may be due noise if it posseses one of the following properties :

  1. It contains very few pixels (the upper limit of which is application specific) and it is not connected to any other structure via an InterscaleRelationship
  2. It is located near the boundary of the signal, in which case it might be due to boundary effects

Author:
John Talbot

Constructor Summary
Structure(Scale scale, int start, int end)
          Construct the Structure.
 
Method Summary
 void addChild(Structure child)
          Add a child structure.
 int compareTo(Object structure)
          Implemation of the Comparable interface to ease sorting in WOBject.
 boolean contains(int position)
          Is the given position contained in this structure.
 List<Structure> getChildren()
          Get a list of children.
 SimpleSignal getCoefficients()
          Get the wavelet coefficients for this structure (zero everywhere else).
 SimpleSignal getCoefficientsMask()
          Get the wavelet coefficients mask for this structure as ones with zeros everywhere else.
 int getEnd()
          Get the end position of this structure.
 float getMaximumValue()
          Get the maximum wavelet coefficient.
 float getMaximumValue(int startLocal, int endLocal)
          Get the maximum wavelet coefficient within the given range.
 Structure getOverlap(Structure structure)
          Get the overlap structure between this structure and given structure.
 Structure getParent()
          Get the parent structure or null if unparented.
 int getPositionOfMaximum()
          Get the position of the maximum within this structure.
 int getPositionOfMaximum(int startLocal, int endLocal)
          Get the position at which the maximum wavelet coefficient occurs within the given bounds.
 Scale getScale()
          Get the scale which contains this structure.
 int getScaleNumber()
          Get the scale number which contains this structure.
 int getSize()
          Get the size of the structure as the number of coefficients.
 int getStart()
          Get the start position of this structure.
 boolean overlaps(Structure structure)
          Does the given structure overlap this structure
 void setParent(Structure parent)
          Set the parent structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Structure

public Structure(Scale scale,
                 int start,
                 int end)
Construct the Structure.

Parameters:
scale - wavelet scale of the wavelet coefficients
start - starting position where the multiresolution support switches from 0 to 1
end - ending position plus 1, like Strings etc...)
Method Detail

getSize

public int getSize()
Get the size of the structure as the number of coefficients.

Returns:
the number of coefficients in this structure

overlaps

public boolean overlaps(Structure structure)
Does the given structure overlap this structure

Parameters:
structure - a structure which we are checking for overlap
Returns:
true if this structure overlaps the given structure

getOverlap

public Structure getOverlap(Structure structure)
Get the overlap structure between this structure and given structure. The method is symmetric however the structures must reside in scales which differ by exatly 1, otherwise null is returned.

Parameters:
structure - the structure in which overlap is sought
Returns:
a structure located in the structure with the largest scale number and containing the overlap between the structures

contains

public boolean contains(int position)
Is the given position contained in this structure.

Parameters:
position - the position
Returns:
true if the given position is contained in this structure

getPositionOfMaximum

public int getPositionOfMaximum()
Get the position of the maximum within this structure.

Returns:
the position of the maximum within this structure

getPositionOfMaximum

public int getPositionOfMaximum(int startLocal,
                                int endLocal)
Get the position at which the maximum wavelet coefficient occurs within the given bounds. Precondition : start ≤ startLocal ≤ end and start ≤ endLocal ≤ end.

Parameters:
startLocal - the lower boundary defining the range to search
endLocal - the upper boundary defining the range to search
Returns:
the position of the maximim within the given range

getMaximumValue

public float getMaximumValue()
Get the maximum wavelet coefficient.

Returns:
the maximum value within the given range

getMaximumValue

public float getMaximumValue(int startLocal,
                             int endLocal)
Get the maximum wavelet coefficient within the given range.

Parameters:
startLocal - the lower boundary defining the range to search
endLocal - the upper boundary defining the range to search
Returns:
the maximum value within the given range

getCoefficients

public SimpleSignal getCoefficients()
Get the wavelet coefficients for this structure (zero everywhere else).

Returns:
the wavelet coefficients of this structure

getCoefficientsMask

public SimpleSignal getCoefficientsMask()
Get the wavelet coefficients mask for this structure as ones with zeros everywhere else.

Returns:
the wavelet coefficient mask for this structure

getStart

public int getStart()
Get the start position of this structure.

Returns:
the start position

getEnd

public int getEnd()
Get the end position of this structure.

Returns:
the end position

getParent

public Structure getParent()
Get the parent structure or null if unparented.

Returns:
a structure representing a parent or null if unparented

setParent

public void setParent(Structure parent)
Set the parent structure. Usually set by the interscale relationship constructor.

Parameters:
parent - a structure representing a parent

getChildren

public List<Structure> getChildren()
Get a list of children. Empty list if there are no children.

Returns:
a list of children structures

addChild

public void addChild(Structure child)
Add a child structure. Usually invoked by interscale relationship constructor.

Parameters:
child - the child structure

getScale

public Scale getScale()
Get the scale which contains this structure.

Returns:
the Scale

getScaleNumber

public int getScaleNumber()
Get the scale number which contains this structure.

Returns:
the scale number

compareTo

public int compareTo(Object structure)
Implemation of the Comparable interface to ease sorting in WOBject.

Specified by:
compareTo in interface Comparable
Parameters:
structure - the structure to compare to
Returns:
negative if position of this structure is less, zero if equal and positive if more