18#ifndef itkMorphologyHistogram_h
19#define itkMorphologyHistogram_h
28template <
typename TInputPixel,
typename TCompare>
32 using MapType =
typename std::map<TInputPixel, IdentifierType, TCompare>;
63 itkAssertInDebugAndIgnoreInReleaseMacro(!
m_Map.empty());
65 auto mapIt =
m_Map.begin();
66 while (mapIt !=
m_Map.end())
68 if (mapIt->second == 0)
74 TInputPixel toErase = mapIt->first;
90 itkAssertInDebugAndIgnoreInReleaseMacro(!
m_Map.empty());
91 return m_Map.begin()->first;
116template <
typename TInputPixel,
typename TCompare>
209template <
typename TCompare>
213template <
typename TCompare>
214class MorphologyHistogram<signed char, TCompare> :
public VectorMorphologyHistogram<signed char, TCompare>
217template <
typename TCompare>
218class MorphologyHistogram<bool, TCompare> :
public VectorMorphologyHistogram<bool, TCompare>
static bool UseVectorBasedAlgorithm()
void SetBoundary(const TInputPixel &val)
void RemovePixel(const TInputPixel &p)
InputImagePixelType m_Boundary
TInputPixel GetValue(const TInputPixel &)
typename std::map< InputImagePixelType, IdentifierType, TCompare > MapType
MorphologyHistogram()=default
void AddPixel(const TInputPixel &p)
static bool UseVectorBasedAlgorithm()
VectorMorphologyHistogram()
std::vector< IdentifierType > m_Vector
TInputPixel m_CurrentValue
void AddPixel(const TInputPixel &p)
void RemovePixel(const TInputPixel &p)
void SetBoundary(const TInputPixel &val)
TInputPixel GetValue(const TInputPixel &)
static constexpr T NonpositiveMin()
static constexpr T max(const T &)