19 #ifndef itkRankHistogram_h
20 #define itkRankHistogram_h
54 template<
typename TInputPixel >
146 for(
typename MapType::iterator it=
m_Map.begin(); it !=
m_Map.end(); it++ )
149 if( count >= target )
162 bool eraseFlag =
false;
164 if ( total < target )
166 typename MapType::iterator searchIt =
m_RankIt;
167 typename MapType::iterator eraseIt;
169 while ( searchIt !=
m_Map.end() )
175 ThisBin = searchIt->second;
179 m_Map.erase(eraseIt);
187 if ( total >= target )
197 typename MapType::iterator searchIt =
m_RankIt;
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 typedef typename std::map< TInputPixel, SizeValueType, TCompare >
MapType;
263 template<
typename TInputPixel >
301 if( count >= target )
330 itkAssertInDebugAndIgnoreInReleaseMacro( q >= 0 );
331 itkAssertInDebugAndIgnoreInReleaseMacro( q < (
int)
m_Vec.size() );
332 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Entries >= 1 );
333 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Vec[q] > 0 );
362 typedef typename std::vector< SizeValueType >
VecType;
385 class RankHistogram<signed char>:
386 public VectorRankHistogram<signed char>
391 class RankHistogram<bool>:
392 public VectorRankHistogram<bool>
TInputPixel GetValueBruteForce()
signed long OffsetValueType
std::less< TInputPixel > TCompare
unsigned long SizeValueType
std::less< TInputPixel > TCompare
TInputPixel GetValue(const TInputPixel &)
RankHistogram & operator=(const RankHistogram &hist)
void RemovePixel(const TInputPixel &p)
static bool UseVectorBasedAlgorithm()
std::map< TInputPixel, SizeValueType, TCompare > MapType
TInputPixel GetValueBruteForce()
void RemovePixel(const TInputPixel &p)
MapType::iterator m_RankIt
static bool UseVectorBasedAlgorithm()
static T NonpositiveMin()
Define additional traits for native types such as int or float.
std::vector< SizeValueType > VecType
void AddPixel(const TInputPixel &p)
void AddPixel(const TInputPixel &p)
TInputPixel GetValue(const TInputPixel &)