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);
172 m_Faces[dimension].first = f;
176 m_Faces[dimension].second = f;
185 return this->GetFlatHash(idx.first, idx.second);
192 return &(m_FlatHashes[dimension].first);
196 return &(m_FlatHashes[dimension].second);
202 this->SetFlatHash(l, idx.first, idx.second);
209 m_FlatHashes[dimension].first = l;
213 m_FlatHashes[dimension].second = l;
225 this->SetValid(l, idx.first, idx.second);
228 SetValid(
bool b,
unsigned int dimension,
unsigned int highlow)
232 m_Valid[dimension].first = b;
236 m_Valid[dimension].second = b;
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{};
270 std::vector<std::pair<flat_hash_t, flat_hash_t>> m_FlatHashes{};
274 std::vector<std::pair<bool, bool>> m_Valid{};
279#ifndef ITK_MANUAL_INSTANTIATION
280# 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