#include <itkOneWayEquivalencyTable.h>
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.
Definition at line 47 of file itkOneWayEquivalencyTable.h.
Public Types | |
using | ConstIterator = HashTableType::const_iterator |
using | HashTableType = std::unordered_map<unsigned long, unsigned long> |
using | Iterator = HashTableType::iterator |
using | ValueType = HashTableType::value_type |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | DataObjectIdentifierType = std::string |
using | DataObjectPointerArraySizeType = std::vector<Pointer>::size_type |
using | Pointer = SmartPointer<Self> |
using | Self = DataObject |
using | Superclass = Object |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | Self = Object |
using | Superclass = LightObject |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | Self = LightObject |
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 () |
bool | IsEntry (const unsigned long a) const |
unsigned long | Lookup (const unsigned long a) const |
unsigned long | RecursiveLookup (const unsigned long a) const |
![]() | |
virtual void | CopyInformation (const DataObject *) |
virtual void | DataHasBeenGenerated () |
void | DisconnectPipeline () |
bool | GetDataReleased () const |
virtual const bool & | GetReleaseDataFlag () const |
SmartPointer< ProcessObject > | GetSource () const |
DataObjectPointerArraySizeType | GetSourceOutputIndex () const |
const DataObjectIdentifierType & | GetSourceOutputName () const |
virtual ModifiedTimeType | GetUpdateMTime () const |
virtual void | Graft (const DataObject *) |
virtual void | Initialize () |
virtual void | PrepareForNewData () |
virtual void | PropagateRequestedRegion () |
void | ReleaseData () |
virtual void | ReleaseDataFlagOff () |
virtual void | ReleaseDataFlagOn () |
virtual bool | RequestedRegionIsOutsideOfTheBufferedRegion () |
virtual void | ResetPipeline () |
void | SetReleaseDataFlag (bool flag) |
virtual void | SetRequestedRegion (const DataObject *) |
virtual void | SetRequestedRegionToLargestPossibleRegion () |
bool | ShouldIReleaseData () const |
virtual void | Update () |
virtual void | UpdateOutputData () |
virtual void | UpdateOutputInformation () |
void | UpdateSource () const |
virtual bool | VerifyRequestedRegion () |
void | SetPipelineMTime (ModifiedTimeType time) |
virtual const ModifiedTimeType & | GetPipelineMTime () const |
virtual void | SetRealTimeStamp (RealTimeStamp _arg) |
virtual const RealTimeStamp & | GetRealTimeStamp () const |
![]() | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
![]() | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Protected Member Functions | |
OneWayEquivalencyTable ()=default | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~OneWayEquivalencyTable () override=default | |
![]() | |
DataObject () | |
virtual void | PropagateResetPipeline () |
~DataObject () override | |
![]() | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
![]() | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Protected Attributes | |
HashTableType | m_HashMap {} |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
using | Self = OneWayEquivalencyTable |
using | Superclass = DataObject |
using | Pointer = SmartPointer<Self> |
using | ConstPointer = SmartPointer<const Self> |
static Pointer | New () |
virtual::itk::LightObject::Pointer | CreateAnother () const |
const char * | GetNameOfClass () const override |
Additional Inherited Members | |
![]() | |
static bool | GetGlobalReleaseDataFlag () |
static void | GlobalReleaseDataFlagOff () |
static void | GlobalReleaseDataFlagOn () |
static Pointer | New () |
static void | SetGlobalReleaseDataFlag (bool val) |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
using itk::OneWayEquivalencyTable::ConstIterator = HashTableType::const_iterator |
Definition at line 65 of file itkOneWayEquivalencyTable.h.
using itk::OneWayEquivalencyTable::ConstPointer = SmartPointer<const Self> |
Standard type alias and smart pointer declarations.
Definition at line 56 of file itkOneWayEquivalencyTable.h.
using itk::OneWayEquivalencyTable::HashTableType = std::unordered_map<unsigned long, unsigned long> |
Define the container type for this table
Definition at line 62 of file itkOneWayEquivalencyTable.h.
using itk::OneWayEquivalencyTable::Iterator = HashTableType::iterator |
Definition at line 64 of file itkOneWayEquivalencyTable.h.
Standard type alias and smart pointer declarations.
Definition at line 55 of file itkOneWayEquivalencyTable.h.
Standard type alias and smart pointer declarations.
Definition at line 53 of file itkOneWayEquivalencyTable.h.
Standard type alias and smart pointer declarations.
Definition at line 54 of file itkOneWayEquivalencyTable.h.
using itk::OneWayEquivalencyTable::ValueType = HashTableType::value_type |
Definition at line 66 of file itkOneWayEquivalencyTable.h.
|
protecteddefault |
Convenience method for debugging.
Referenced by GetNameOfClass().
|
overrideprotecteddefault |
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).
|
inline |
Returns an iterator pointing to the first element of the (unordered) table.
Definition at line 144 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
inline |
Erases all the entries in the table.
Definition at line 129 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
virtual |
Standard type alias and smart pointer declarations.
Reimplemented from itk::Object.
|
inline |
Returns TRUE if the table is empty, FALSE if it is not empty.
Definition at line 136 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
inline |
Returns and iterator pointing to one position past the last element of the (unordered) table.
Definition at line 152 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
inline |
Erases the entry with key a.
Definition at line 122 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
void itk::OneWayEquivalencyTable::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}.
|
overridevirtual |
Standard type alias and smart pointer declarations.
Reimplemented from itk::DataObject.
References OneWayEquivalencyTable().
|
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 110 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
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 88 of file itkOneWayEquivalencyTable.h.
References m_HashMap.
|
static |
Standard type alias and smart pointer declarations.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
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.
|
protected |