18 #ifndef __itkThresholdLabelerImageFilter_h
19 #define __itkThresholdLabelerImageFilter_h
44 template<
class TInput,
class TOutput >
56 { m_Thresholds = thresholds; }
59 void SetLabelOffset(
const TOutput & labelOffset)
60 { m_LabelOffset = labelOffset; }
74 return !( *
this != other );
77 inline TOutput operator()(
const TInput & A)
const
79 unsigned int size = m_Thresholds.size();
85 if ( A <= m_Thresholds[0] )
89 for (
unsigned int i = 0; i < size - 1; i++ )
92 if ( m_Thresholds[i] < A && A <= m_Thresholds[i + 1] )
94 return static_cast< TOutput
>( i + 1 ) + m_LabelOffset;
97 return static_cast< TOutput
>( size ) + m_LabelOffset;
107 template<
class TInputImage,
class TOutputImage >
111 Functor::ThresholdLabeler<
112 typename TInputImage::PixelType,
113 typename TOutputImage::PixelType > >
119 TInputImage, TOutputImage,
121 typename TInputImage::PixelType,
122 typename TOutputImage::PixelType >
144 #ifdef ITK_USE_CONCEPT_CHECKING
162 typename ThresholdVector::const_iterator itr =
m_Thresholds.begin();
181 typename RealThresholdVector::const_iterator itr =
m_RealThresholds.begin();
184 m_Thresholds.push_back( static_cast< InputPixelType >( *itr ) );
220 #ifndef ITK_MANUAL_INSTANTIATION
221 #include "itkThresholdLabelerImageFilter.hxx"