ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
itk::OneWayEquivalencyTable Class Reference

#include <itkOneWayEquivalencyTable.h>

+ Inheritance diagram for itk::OneWayEquivalencyTable:
+ Collaboration diagram for itk::OneWayEquivalencyTable:

List of all members.

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

HashTableType m_HashMap
typedef OneWayEquivalencyTable Self
typedef DataObject Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const SelfConstPointer
static Pointer New ()
virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const

Detailed Description

Hash table to manage integral label equivalencies that are order dependent.

OneWayEquivalencyTable is a variation on itk::EquivalencyTable that preserves the order of equivalencies. For example, the entries { 5 = 4 } and {4 = 5} are not equivalent in this table, yet are the treated as the same entry in EquivalencyTable. Because of the one-way logic of the table, reflexive equivalencies will result in cycling from recursive lookups or flattening of the table. The responsibility is on the user for preventing recursive cycling.

See itk::EquivalencyTable for more information
See also:
EquivalencyTable

Definition at line 45 of file itkOneWayEquivalencyTable.h.


Member Typedef Documentation

typedef HashTableType::const_iterator itk::OneWayEquivalencyTable::ConstIterator

Definition at line 62 of file itkOneWayEquivalencyTable.h.

Standard typedefs and smart pointer declarations.

Reimplemented from itk::DataObject.

Definition at line 52 of file itkOneWayEquivalencyTable.h.

typedef itksys::hash_map< unsigned long, unsigned long, itksys::hash< unsigned long > > itk::OneWayEquivalencyTable::HashTableType

Define the container type for this table

Definition at line 54 of file itkOneWayEquivalencyTable.h.

typedef HashTableType::iterator itk::OneWayEquivalencyTable::Iterator

Definition at line 61 of file itkOneWayEquivalencyTable.h.

Standard typedefs and smart pointer declarations.

Reimplemented from itk::DataObject.

Definition at line 51 of file itkOneWayEquivalencyTable.h.

Standard typedefs and smart pointer declarations.

Reimplemented from itk::DataObject.

Definition at line 49 of file itkOneWayEquivalencyTable.h.

Standard typedefs and smart pointer declarations.

Reimplemented from itk::DataObject.

Definition at line 50 of file itkOneWayEquivalencyTable.h.

typedef HashTableType::value_type itk::OneWayEquivalencyTable::ValueType

Definition at line 63 of file itkOneWayEquivalencyTable.h.


Constructor & Destructor Documentation

Convenience method for debugging.

Definition at line 128 of file itkOneWayEquivalencyTable.h.

virtual itk::OneWayEquivalencyTable::~OneWayEquivalencyTable ( ) [inline, protected, virtual]

Convenience method for debugging.

Definition at line 129 of file itkOneWayEquivalencyTable.h.

Convenience method for debugging.


Member Function Documentation

bool itk::OneWayEquivalencyTable::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).

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

Definition at line 119 of file itkOneWayEquivalencyTable.h.

void itk::OneWayEquivalencyTable::Clear ( void  ) [inline]

Erases all the entries in the table.

Definition at line 110 of file itkOneWayEquivalencyTable.h.

virtual::itk::LightObject::Pointer itk::OneWayEquivalencyTable::CreateAnother ( void  ) const [virtual]

Standard typedefs and smart pointer declarations.

Reimplemented from itk::Object.

bool itk::OneWayEquivalencyTable::Empty ( ) const [inline]

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

Definition at line 114 of file itkOneWayEquivalencyTable.h.

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

Definition at line 123 of file itkOneWayEquivalencyTable.h.

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

Erases the entry with key a.

Definition at line 106 of file itkOneWayEquivalencyTable.h.

``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::OneWayEquivalencyTable::GetNameOfClass ( ) const [virtual]

Standard typedefs and smart pointer declarations.

Reimplemented from itk::DataObject.

bool itk::OneWayEquivalencyTable::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 98 of file itkOneWayEquivalencyTable.h.

unsigned long itk::OneWayEquivalencyTable::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 82 of file itkOneWayEquivalencyTable.h.

Standard typedefs and smart pointer declarations.

Reimplemented from itk::Object.

void itk::OneWayEquivalencyTable::operator= ( const Self ) [protected]

Convenience method for debugging.

Reimplemented from itk::DataObject.

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

Method for grafting the content of one data object into another one. This method is intended to be overloaded by derived classes. Each one of them should use dynamic_casting in order to verify that the grafted object is actually of the same type as the class on which the Graft() method was invoked.

Reimplemented from itk::DataObject.

unsigned long itk::OneWayEquivalencyTable::RecursiveLookup ( const unsigned long  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.


Member Data Documentation

Definition at line 136 of file itkOneWayEquivalencyTable.h.


The documentation for this class was generated from the following file: