18#ifndef itkWatershedBoundary_h
19#define itkWatershedBoundary_h
26#include <unordered_map>
53template <
typename TScalar,
unsigned int TDimension>
57 ITK_DISALLOW_COPY_AND_MOVE(
Boundary);
63 static constexpr unsigned int Dimension = TDimension;
69 using IndexType = std::pair<unsigned int, unsigned int>;
124 using flat_hash_t = std::unordered_map<IdentifierType, flat_region_t>;
144 return this->GetFace(idx.first, idx.second);
151 GetFace(
unsigned int dimension,
unsigned int highlow)
155 return m_Faces[dimension].first;
159 return m_Faces[dimension].second;
167 this->SetFace(f, idx.first, idx.second);
175 m_Faces[dimension].first = f;
179 m_Faces[dimension].second = f;
188 return this->GetFlatHash(idx.first, idx.second);
195 return &(m_FlatHashes[dimension].first);
199 return &(m_FlatHashes[dimension].second);
207 this->SetFlatHash(l, idx.first, idx.second);
214 m_FlatHashes[dimension].first = l;
218 m_FlatHashes[dimension].second = l;
230 this->SetValid(l, idx.first, idx.second);
233 SetValid(
bool b,
unsigned int dimension,
unsigned int highlow)
237 m_Valid[dimension].first = b;
241 m_Valid[dimension].second = b;
250 return this->GetValid(idx.first, idx.second);
253 GetValid(
unsigned int dimension,
unsigned int highlow)
const
257 return m_Valid[dimension].first;
261 return m_Valid[dimension].second;
273 std::vector<std::pair<FacePointer, FacePointer>> m_Faces{};
277 std::vector<std::pair<flat_hash_t, flat_hash_t>> m_FlatHashes{};
281 std::vector<std::pair<bool, bool>> m_Valid{};
286#ifndef ITK_MANUAL_INSTANTIATION
287# include "itkWatershedBoundary.hxx"
Base class for all data objects in ITK.
Templated n-dimensional image class.
Control indentation during Print() invocation.
Base class for most ITK classes.
flat_hash_t * GetFlatHash(const IndexType &idx)
flat_hash_t * GetFlatHash(unsigned int dimension, unsigned int highlow)
bool GetValid(unsigned int dimension, unsigned int highlow) const
void SetValid(bool b, unsigned int dimension, unsigned int highlow)
void SetFace(FacePointer f, unsigned int dimension, unsigned int highlow)
void SetValid(bool &l, const IndexType &idx)
~Boundary() override=default
void SetFace(FacePointer f, const IndexType &idx)
typename face_t::Pointer FacePointer
bool GetValid(const IndexType &idx) const
std::pair< unsigned int, unsigned int > IndexType
std::unordered_map< IdentifierType, flat_region_t > flat_hash_t
void PrintSelf(std::ostream &os, Indent indent) const override
typename flat_hash_t::value_type FlatHashValueType
void SetFlatHash(flat_hash_t &l, const IndexType &idx)
typename ImageType::IndexType ImageIndexType
FacePointer GetFace(const IndexType &idx)
FacePointer GetFace(unsigned int dimension, unsigned int highlow)
void SetFlatHash(flat_hash_t &l, unsigned int dimension, unsigned int highlow)
SmartPointer< Self > Pointer
ImageBaseType::IndexType IndexType
constexpr unsigned int Dimension
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT DataObject
SizeValueType IdentifierType
std::list< IdentifierType > offset_list