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;
158 return m_Faces[dimension].second;
164 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)
245 return this->
GetValid(idx.first, idx.second);
248 GetValid(
unsigned int dimension,
unsigned int highlow)
const
252 return m_Valid[dimension].first;
255 return m_Valid[dimension].second;
266 std::vector<std::pair<FacePointer, FacePointer>>
m_Faces{};
279#ifndef ITK_MANUAL_INSTANTIATION
280# 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)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
std::list< IdentifierType > offset_list