19 #ifndef itkRankHistogram_h
20 #define itkRankHistogram_h
51 template<
typename TInputPixel >
143 for(
typename MapType::iterator it=
m_Map.begin(); it !=
m_Map.end(); it++ )
146 if( count >= target )
159 bool eraseFlag =
false;
161 if ( total < target )
163 typename MapType::iterator searchIt =
m_RankIt;
164 typename MapType::iterator eraseIt;
166 while ( searchIt !=
m_Map.end() )
172 ThisBin = searchIt->second;
176 m_Map.erase(eraseIt);
184 if ( total >= target )
189 if (searchIt ==
m_Map.end())
198 typename MapType::iterator searchIt =
m_RankIt;
199 typename MapType::iterator eraseIt;
201 while ( searchIt !=
m_Map.begin() )
203 ThisBin = searchIt->second;
204 unsigned int tbelow = total - ThisBin;
205 if ( tbelow < target )
211 m_Map.erase(eraseIt);
250 typedef typename std::map< TInputPixel, SizeValueType, Compare >
MapType;
265 template<
typename TInputPixel >
303 if( count >= target )
332 itkAssertInDebugAndIgnoreInReleaseMacro( q >= 0 );
333 itkAssertInDebugAndIgnoreInReleaseMacro( q < (
int)
m_Vec.size() );
334 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Entries >= 1 );
335 itkAssertInDebugAndIgnoreInReleaseMacro(
m_Vec[q] > 0 );
364 typedef typename std::vector< SizeValueType >
VecType;
387 class RankHistogram<signed char>:
388 public VectorRankHistogram<signed char>
393 class RankHistogram<bool>:
394 public VectorRankHistogram<bool>
TInputPixel GetValueBruteForce()
signed long OffsetValueType
unsigned long SizeValueType
TInputPixel GetValue(const TInputPixel &)
static ITK_CONSTEXPR_FUNC T max(const T &)
RankHistogram & operator=(const RankHistogram &hist)
std::less< TInputPixel > Compare
std::map< TInputPixel, SizeValueType, Compare > MapType
void RemovePixel(const TInputPixel &p)
static bool UseVectorBasedAlgorithm()
static ITK_CONSTEXPR_FUNC T NonpositiveMin()
TInputPixel GetValueBruteForce()
void RemovePixel(const TInputPixel &p)
MapType::iterator m_RankIt
static bool UseVectorBasedAlgorithm()
std::less< TInputPixel > Compare
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 &)