17 #ifndef __itkThresholdLabelerImageFilter_h
18 #define __itkThresholdLabelerImageFilter_h
22 #include "itkNumericTraits.h"
44 template<
class TInput,
class TOutput >
56 { m_Thresholds = thresholds; }
59 void SetLabelOffset(
const TOutput & labelOffset )
60 { m_LabelOffset = labelOffset; }
73 return !(*
this != other);
76 inline TOutput operator()(
const TInput & A )
const
78 unsigned int size = m_Thresholds.size();
83 if (A <= m_Thresholds[0])
87 for (
unsigned int i=0; i<size-1; i++)
90 if (m_Thresholds[i] < A && A <= m_Thresholds[i+1])
92 return static_cast<TOutput
>(i+1) + m_LabelOffset;
95 return static_cast<TOutput
>(size) + m_LabelOffset;
105 template <
class TInputImage,
class TOutputImage>
109 Functor::ThresholdLabeler<
110 typename TInputImage::PixelType,
111 typename TOutputImage::PixelType> >
117 TInputImage,TOutputImage,
119 typename TInputImage::PixelType,
120 typename TOutputImage::PixelType>
142 #ifdef ITK_USE_CONCEPT_CHECKING
158 typename ThresholdVector::const_iterator itr =
m_Thresholds.begin();
176 typename RealThresholdVector::const_iterator itr =
m_RealThresholds.begin();
179 m_Thresholds.push_back( static_cast< InputPixelType >( *itr ) );
213 #ifndef ITK_MANUAL_INSTANTIATION