18#ifndef itkWatershedBoundary_h
19#define itkWatershedBoundary_h
26#include <unordered_map>
51template <
typename TScalar,
unsigned int TDimension>
55 ITK_DISALLOW_COPY_AND_MOVE(
Boundary);
61 static constexpr unsigned int Dimension = TDimension;
67 using IndexType = std::pair<unsigned int, unsigned int>;
122 using flat_hash_t = std::unordered_map<IdentifierType, flat_region_t>;
142 return this->
GetFace(idx.first, idx.second);
149 GetFace(
unsigned int dimension,
unsigned int highlow)
153 return m_Faces[dimension].first;
156 return m_Faces[dimension].second;
162 this->
SetFace(f, idx.first, idx.second);
225 this->
SetValid(l, idx.first, idx.second);
228 SetValid(
bool b,
unsigned int dimension,
unsigned int highlow)
244 return this->
GetValid(idx.first, idx.second);
247 GetValid(
unsigned int dimension,
unsigned int highlow)
const
251 return m_Valid[dimension].first;
254 return m_Valid[dimension].second;
266 std::vector<std::pair<FacePointer, FacePointer>>
m_Faces{};
278#ifndef ITK_MANUAL_INSTANTIATION
279# include "itkWatershedBoundary.hxx"
Templated n-dimensional image class.
SmartPointer< Self > Pointer
Index< VImageDimension > IndexType
Control indentation during Print() invocation.
virtual void Modified() const
Implements transparent reference counting.
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
SmartPointer< Self > Pointer
void SetValid(bool b, unsigned int dimension, unsigned int highlow)
Image< IdentifierType, TDimension > ImageType
static constexpr unsigned int Dimension
void SetFace(FacePointer f, unsigned int dimension, unsigned int highlow)
std::vector< std::pair< FacePointer, FacePointer > > m_Faces
SmartPointer< const Self > ConstPointer
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)
Image< face_pixel_t, TDimension > face_t
std::vector< std::pair< flat_hash_t, flat_hash_t > > m_FlatHashes
typename ImageType::IndexType ImageIndexType
std::vector< std::pair< bool, bool > > m_Valid
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)
SizeValueType IdentifierType
std::list< IdentifierType > offset_list