18 #ifndef itkThresholdLabelerImageFilter_h
19 #define itkThresholdLabelerImageFilter_h
45 template <
typename TInput,
typename TOutput>
60 m_Thresholds = thresholds;
67 m_LabelOffset = labelOffset;
83 return !(*
this != other);
89 size_t size = m_Thresholds.size();
95 if (A <= m_Thresholds[0])
99 for (
size_t i = 0; i < size - 1; i++)
102 if (m_Thresholds[i] < A && A <= m_Thresholds[i + 1])
104 return static_cast<TOutput>(i + 1) + m_LabelOffset;
107 return static_cast<TOutput>(size) + m_LabelOffset;
116 template <
typename TInputImage,
typename TOutputImage>
121 Functor::ThresholdLabeler<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
152 #ifdef ITK_USE_CONCEPT_CHECKING
165 m_Thresholds = thresholds;
166 m_RealThresholds.clear();
167 typename ThresholdVector::const_iterator itr = m_Thresholds.begin();
168 while (itr != m_Thresholds.end())
170 m_RealThresholds.push_back(static_cast<RealThresholdType>(*itr));
178 const ThresholdVector &
188 m_RealThresholds = thresholds;
189 m_Thresholds.clear();
190 typename RealThresholdVector::const_iterator itr = m_RealThresholds.begin();
191 while (itr != m_RealThresholds.end())
193 m_Thresholds.push_back(static_cast<InputPixelType>(*itr));
201 const RealThresholdVector &
204 return m_RealThresholds;
208 itkSetClampMacro(LabelOffset,
212 itkGetConstMacro(LabelOffset, OutputPixelType);
219 PrintSelf(std::ostream & os,
Indent indent)
const override;
224 BeforeThreadedGenerateData()
override;
233 #ifndef ITK_MANUAL_INSTANTIATION
234 # include "itkThresholdLabelerImageFilter.hxx"