18#ifndef itkEquivalencyTable_h
19#define itkEquivalencyTable_h
23#include <unordered_map>
59 using HashTableType = std::unordered_map<unsigned long, unsigned long, std::hash<unsigned long>>;
78 Add(
unsigned long a,
unsigned long b);
96 auto result = m_HashMap.find(a);
98 if (result == m_HashMap.end())
103 return result->second;
118 if (m_HashMap.find(a) == m_HashMap.end())
144 return m_HashMap.empty();
148 HashTableType::size_type
151 return m_HashMap.size();
159 return m_HashMap.begin();
167 return m_HashMap.end();
Base class for all data objects in ITK.
Hash table to manage integral label equivalencies.
unsigned long RecursiveLookup(const unsigned long a) const
void PrintSelf(std::ostream &os, Indent indent) const override
EquivalencyTable()=default
unsigned long Lookup(const unsigned long a) const
HashTableType::size_type Size() const
bool Add(unsigned long a, unsigned long b)
HashTableType::value_type ValueType
bool AddAndFlatten(unsigned long a, unsigned long b)
HashTableType::iterator Iterator
bool IsEntry(const unsigned long a) const
~EquivalencyTable() override=default
HashTableType::const_iterator ConstIterator
std::unordered_map< unsigned long, unsigned long, std::hash< unsigned long > > HashTableType
void Erase(const unsigned long a)
Control indentation during Print() invocation.
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT DataObject