19#ifndef itkRankHistogram_h
20#define itkRankHistogram_h
48template <
typename TInputPixel>
141 for (
typename MapType::iterator it =
m_Map.begin(); it !=
m_Map.end(); ++it)
158 bool eraseFlag =
false;
163 typename MapType::iterator eraseIt;
165 while (searchIt !=
m_Map.end())
175 m_Map.erase(eraseIt);
188 if (searchIt ==
m_Map.end())
198 typename MapType::iterator eraseIt;
200 while (searchIt !=
m_Map.begin())
203 const unsigned int tbelow = total - ThisBin;
210 m_Map.erase(eraseIt);
255 using MapType =
typename std::map<TInputPixel, SizeValueType, Compare>;
270template <
typename TInputPixel>
342 itkAssertInDebugAndIgnoreInReleaseMacro(q >= 0);
343 itkAssertInDebugAndIgnoreInReleaseMacro(q <
static_cast<int>(
m_Vec.size()));
344 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Entries >= 1);
345 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Vec[q] > 0);
380 using VecType =
typename std::vector<SizeValueType>;
401class RankHistogram<signed char> :
public VectorRankHistogram<signed char>
405class ITK_TEMPLATE_EXPORT RankHistogram<bool> :
public VectorRankHistogram<bool>
std::less< TInputPixel > Compare
TInputPixel GetValue(const TInputPixel &)
MapType::iterator m_RankIt
typename std::map< TInputPixel, SizeValueType, Compare > MapType
TInputPixel GetValueBruteForce()
RankHistogram & operator=(const RankHistogram &hist)
void AddPixel(const TInputPixel &p)
void RemovePixel(const TInputPixel &p)
static bool UseVectorBasedAlgorithm()
static bool UseVectorBasedAlgorithm()
TInputPixel GetValueBruteForce()
typename std::vector< SizeValueType > VecType
void RemovePixel(const TInputPixel &p)
void AddPixel(const TInputPixel &p)
~VectorRankHistogram()=default
std::less< TInputPixel > Compare
TInputPixel GetValue(const TInputPixel &)
Define additional traits for native types such as int or float.
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
unsigned long SizeValueType