18#ifndef itkThresholdLabelerImageFilter_h
19#define itkThresholdLabelerImageFilter_h
45template <
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;
112template <
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())
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())
197 const RealThresholdVector &
200 return m_RealThresholds;
226#ifndef ITK_MANUAL_INSTANTIATION
227# include "itkThresholdLabelerImageFilter.hxx"
~ThresholdLabeler()=default
RealThresholdVector m_Thresholds
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ThresholdLabeler)
void SetThresholds(const RealThresholdVector &thresholds)
bool operator==(const ThresholdLabeler &other) const
std::vector< RealThresholdType > RealThresholdVector
void SetLabelOffset(const TOutput &labelOffset)
TOutput operator()(const TInput &A) const
typename NumericTraits< TInput >::RealType RealThresholdType
Base class for all process objects that output image data.
Control indentation during Print() invocation.
Define additional traits for native types such as int or float.
static constexpr T max(const T &)
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Label an input image according to a set of thresholds.
std::vector< InputPixelType > ThresholdVector
void BeforeThreadedGenerateData() override
typename NumericTraits< InputPixelType >::RealType RealThresholdType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetThresholds(const ThresholdVector &thresholds)
std::vector< RealThresholdType > RealThresholdVector
const RealThresholdVector & GetRealThresholds() const
const ThresholdVector & GetThresholds() const
void SetRealThresholds(const RealThresholdVector &thresholds)
~ThresholdLabelerImageFilter() override=default
ThresholdLabelerImageFilter()
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::PixelType InputPixelType
Implements pixel-wise generic operation on one image.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....