Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::EquivalencyTable Class Reference
[Watershed-based Segmentation Filters]

Hash table to manage integral label equivalencies. More...

#include <itkEquivalencyTable.h>

Inheritance diagram for itk::EquivalencyTable:

Inheritance graph
[legend]
Collaboration diagram for itk::EquivalencyTable:

Collaboration graph
[legend]
List of all members.

[NOHEADER]

typedef EquivalencyTable Self
typedef DataObject Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
virtual const char * GetNameOfClass () const
Pointer New ()

Public Types

typedef itk::hash_map< unsigned
long, unsigned long, itk::hash<
unsigned long > > 
HashTableType
typedef HashTableType::iterator Iterator
typedef HashTableType::const_iterator ConstIterator
typedef HashTableType::value_type ValueType

Public Member Functions

void Flatten ()
bool Add (unsigned long a, unsigned long b)
bool AddAndFlatten (unsigned long a, unsigned long b)
unsigned long RecursiveLookup (const unsigned a) const
void Erase (const unsigned long a)
void Clear ()
bool Empty () const
HashTableType::size_type Size () const
Iterator Begin ()
Iterator End ()
unsigned long Lookup (const unsigned long a) const
bool IsEntry (const unsigned long a) const

Protected Member Functions

 EquivalencyTable ()
virtual ~EquivalencyTable ()
 EquivalencyTable (const Self &)
void operator= (const Self &)
void PrintSelf (std::ostream &os, Indent indent) const

Protected Attributes

HashTableType m_HashMap

Detailed Description

Hash table to manage integral label equivalencies.

EquivalencyTable is a hash table for recording equivalencies among unsigned long integer values. EquivalencyTable can store recursive relationships (8=7, 7=6, 6=5, ...) or be ``flattened'' to eliminate recursion. The table uses an efficient algorithm for eliminating redundancy and preventing circular dependencies.

In the context of the watershed segmentation algorithm (itk::WatershedImageFilter), this table is used to store connections identified among image segments and as the input to itk::watershed::Relabeler.

Definition at line 47 of file itkEquivalencyTable.h.


Member Typedef Documentation

typedef HashTableType::const_iterator itk::EquivalencyTable::ConstIterator
 

Definition at line 63 of file itkEquivalencyTable.h.

Referenced by Lookup().

typedef SmartPointer<const Self> itk::EquivalencyTable::ConstPointer
 

Standard smart pointer declarations

Reimplemented from itk::DataObject.

Definition at line 54 of file itkEquivalencyTable.h.

typedef itk::hash_map<unsigned long, unsigned long, itk::hash<unsigned long> > itk::EquivalencyTable::HashTableType
 

Define the container type for the table.

Definition at line 61 of file itkEquivalencyTable.h.

Referenced by ~EquivalencyTable().

typedef HashTableType::iterator itk::EquivalencyTable::Iterator
 

Definition at line 62 of file itkEquivalencyTable.h.

typedef SmartPointer<Self> itk::EquivalencyTable::Pointer
 

Standard smart pointer declarations

Reimplemented from itk::DataObject.

Definition at line 53 of file itkEquivalencyTable.h.

Referenced by itk::watershed::Segmenter< InputImageType >::GetLargestPossibleRegion(), and itk::watershed::Segmenter< InputImageType >::operator=().

typedef EquivalencyTable itk::EquivalencyTable::Self
 

Standard smart pointer declarations

Reimplemented from itk::DataObject.

Definition at line 51 of file itkEquivalencyTable.h.

Referenced by EquivalencyTable().

typedef DataObject itk::EquivalencyTable::Superclass
 

Standard smart pointer declarations

Reimplemented from itk::DataObject.

Definition at line 52 of file itkEquivalencyTable.h.

typedef HashTableType::value_type itk::EquivalencyTable::ValueType
 

Definition at line 64 of file itkEquivalencyTable.h.


Constructor & Destructor Documentation

itk::EquivalencyTable::EquivalencyTable  )  [inline, protected]
 

Convenience method for debugging.

Definition at line 141 of file itkEquivalencyTable.h.

References Self.

virtual itk::EquivalencyTable::~EquivalencyTable  )  [inline, protected, virtual]
 

Convenience method for debugging.

Definition at line 142 of file itkEquivalencyTable.h.

References HashTableType.

itk::EquivalencyTable::EquivalencyTable const Self  )  [protected]
 

Convenience method for debugging.


Member Function Documentation

bool itk::EquivalencyTable::Add unsigned long  a,
unsigned long  b
 

Insert an equivalency into the table. A return value of TRUE indicates that the equivalency did not previously exist in the table and was successfully added. A FALSE return value indicates that the equivalency was not added to the table because a conflict with an existing entry occurred (most likely, the equivalency was already recorded directly or indirectly).

bool itk::EquivalencyTable::AddAndFlatten unsigned long  a,
unsigned long  b
 

Insert an equivalency into the table and flatten that equivalency. A return value of TRUE indicates that the equivalency did not previously exist in the table and was successfully added. A FALSE return value indicates that the equivalency was not added to the table because a conflict with an existing entry occurred (most likely, the equivalency was already recorded directly or indirectly).

Iterator itk::EquivalencyTable::Begin  )  [inline]
 

Returns an iterator pointing to the first element of the (unordered) table.

Definition at line 132 of file itkEquivalencyTable.h.

void itk::EquivalencyTable::Clear  )  [inline]
 

Erases all the entries in the table.

Definition at line 119 of file itkEquivalencyTable.h.

bool itk::EquivalencyTable::Empty  )  const [inline]
 

Returns TRUE if the table is empty, FALSE if it is not empty.

Definition at line 123 of file itkEquivalencyTable.h.

Iterator itk::EquivalencyTable::End  )  [inline]
 

Returns and iterator pointing to one position past the last element of the (unordered) table.

Definition at line 136 of file itkEquivalencyTable.h.

void itk::EquivalencyTable::Erase const unsigned long  a  )  [inline]
 

Erases the entry with key a.

Definition at line 115 of file itkEquivalencyTable.h.

void itk::EquivalencyTable::Flatten  ) 
 

``Flattens'' the equivalency table by eliminating all redundant and recursive equivalencies. I.e. the set { 2=1; 3=2; 4=3 } is converted to {4=1; 3=1; 2=1}.

virtual const char* itk::EquivalencyTable::GetNameOfClass  )  const [virtual]
 

Standard smart pointer declarations

Reimplemented from itk::DataObject.

bool itk::EquivalencyTable::IsEntry const unsigned long  a  )  const [inline]
 

Returns TRUE if the label is found in the table and FALSE is the label is not found in the table.

Definition at line 107 of file itkEquivalencyTable.h.

unsigned long itk::EquivalencyTable::Lookup const unsigned long  a  )  const [inline]
 

Lookup an equivalency in the table. If no entry is found in the table, the method returns its the value of the argument. Does not recursively descent through equivalencies.

Definition at line 91 of file itkEquivalencyTable.h.

References ConstIterator.

Pointer itk::EquivalencyTable::New  )  [static]
 

Standard smart pointer declarations

Reimplemented from itk::Object.

void itk::EquivalencyTable::operator= const Self  )  [protected]
 

Convenience method for debugging.

Reimplemented from itk::DataObject.

void itk::EquivalencyTable::PrintSelf std::ostream &  os,
Indent  indent
const [protected, virtual]
 

Convenience method for debugging.

Reimplemented from itk::DataObject.

unsigned long itk::EquivalencyTable::RecursiveLookup const unsigned  a  )  const
 

Lookup an equivalency in the table by recursing through all successive equivalencies. For example, if the follow entries exist in the table {8=7, 7=6, 6=5}, then RecursiveLookup(8) returns 5.

HashTableType::size_type itk::EquivalencyTable::Size void   )  const [inline]
 

Returns the number of entries in the table.

Definition at line 127 of file itkEquivalencyTable.h.


Member Data Documentation

HashTableType itk::EquivalencyTable::m_HashMap [protected]
 

Definition at line 148 of file itkEquivalencyTable.h.


The documentation for this class was generated from the following file:
Generated at Thu May 25 00:50:32 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000