18 #ifndef itkWatershedBoundary_h
19 #define itkWatershedBoundary_h
26 #include <unordered_map>
53 template <
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>;
134 itkOverrideGetNameOfClassMacro(
Boundary);
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;
270 PrintSelf(std::ostream & os,
Indent indent)
const override;
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"