18 #ifndef itkThresholdLabelerImageFilter_h
19 #define itkThresholdLabelerImageFilter_h
45 template <
typename TInput,
typename TOutput>
60 m_Thresholds = thresholds;
67 m_LabelOffset = labelOffset;
89 size_t high = m_Thresholds.size();
92 const size_t mid = (low + high) / 2;
93 if (A <= m_Thresholds[mid])
103 return static_cast<TOutput>(low) + m_LabelOffset;
112 template <
typename TInputImage,
typename TOutputImage>
117 Functor::ThresholdLabeler<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
148 #ifdef ITK_USE_CONCEPT_CHECKING
161 m_Thresholds = thresholds;
162 m_RealThresholds.clear();
163 typename ThresholdVector::const_iterator itr = m_Thresholds.begin();
164 while (itr != m_Thresholds.end())
166 m_RealThresholds.push_back(static_cast<RealThresholdType>(*itr));
174 const ThresholdVector &
184 m_RealThresholds = thresholds;
185 m_Thresholds.clear();
186 typename RealThresholdVector::const_iterator itr = m_RealThresholds.begin();
187 while (itr != m_RealThresholds.end())
189 m_Thresholds.push_back(static_cast<InputPixelType>(*itr));
197 const RealThresholdVector &
200 return m_RealThresholds;
205 itkGetConstMacro(LabelOffset, OutputPixelType);
209 ThresholdLabelerImageFilter();
210 ~ThresholdLabelerImageFilter()
override =
default;
212 PrintSelf(std::ostream & os, Indent indent)
const override;
217 BeforeThreadedGenerateData()
override;
226 #ifndef ITK_MANUAL_INSTANTIATION
227 # include "itkThresholdLabelerImageFilter.hxx"