19 #ifndef itkRankHistogram_h
20 #define itkRankHistogram_h
51 template<
typename TInputPixel >
142 for(
typename MapType::iterator it=
m_Map.begin(); it !=
m_Map.end(); it++ )
145 if( count >= target )
158 bool eraseFlag =
false;
160 if ( total < target )
163 typename MapType::iterator eraseIt;
165 while ( searchIt !=
m_Map.end() )
171 ThisBin = searchIt->second;
175 m_Map.erase(eraseIt);
183 if ( total >= target )
188 if (searchIt ==
m_Map.end())
198 typename MapType::iterator eraseIt;
200 while ( searchIt !=
m_Map.begin() )
202 ThisBin = searchIt->second;
203 unsigned int tbelow = total - ThisBin;
204 if ( tbelow < target )
210 m_Map.erase(eraseIt);
249 using MapType =
typename std::map< TInputPixel, SizeValueType, Compare >;
264 template<
typename TInputPixel >
302 if( count >= target )
331 itkAssertInDebugAndIgnoreInReleaseMacro( q >= 0 );
332 itkAssertInDebugAndIgnoreInReleaseMacro( q < (
int)
m_Vec.size() );
333 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Entries >= 1 );
334 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Vec[q] > 0 );
363 using VecType =
typename std::vector< SizeValueType >;
386 class RankHistogram<signed char>:
387 public VectorRankHistogram<signed char>
392 class RankHistogram<bool>:
393 public VectorRankHistogram<bool>
std::less< TInputPixel > Compare
~VectorRankHistogram()=default
TInputPixel GetValueBruteForce()
Define numeric traits for std::vector.
unsigned long SizeValueType
TInputPixel GetValue(const TInputPixel &)
typename std::map< TInputPixel, SizeValueType, Compare > MapType
RankHistogram & operator=(const RankHistogram &hist)
std::less< TInputPixel > Compare
void RemovePixel(const TInputPixel &p)
static bool UseVectorBasedAlgorithm()
TInputPixel GetValueBruteForce()
void RemovePixel(const TInputPixel &p)
MapType::iterator m_RankIt
static bool UseVectorBasedAlgorithm()
void AddPixel(const TInputPixel &p)
typename std::vector< SizeValueType > VecType
signed long OffsetValueType
void AddPixel(const TInputPixel &p)
TInputPixel GetValue(const TInputPixel &)