ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkOtsuMultipleThresholdsImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkOtsuMultipleThresholdsImageFilter_h
19#define itkOtsuMultipleThresholdsImageFilter_h
20
22#include "itkFixedArray.h"
25
26namespace itk
27{
59
60template <typename TInputImage, typename TOutputImage>
61class ITK_TEMPLATE_EXPORT OtsuMultipleThresholdsImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(OtsuMultipleThresholdsImageFilter);
65
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(OtsuMultipleThresholdsImageFilter);
77
79 using InputPixelType = typename TInputImage::PixelType;
80 using OutputPixelType = typename TOutputImage::PixelType;
81
83 using InputImagePointer = typename TInputImage::Pointer;
84 using OutputImagePointer = typename TOutputImage::Pointer;
85
86 using InputSizeType = typename TInputImage::SizeType;
87 using InputIndexType = typename TInputImage::IndexType;
88 using InputImageRegionType = typename TInputImage::RegionType;
89 using OutputSizeType = typename TOutputImage::SizeType;
90 using OutputIndexType = typename TOutputImage::IndexType;
91 using OutputImageRegionType = typename TOutputImage::RegionType;
92
98
100 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
101 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
102
104 itkSetClampMacro(NumberOfHistogramBins, SizeValueType, 1, NumericTraits<SizeValueType>::max());
105 itkGetConstMacro(NumberOfHistogramBins, SizeValueType);
107
109 itkSetClampMacro(NumberOfThresholds, SizeValueType, 1, NumericTraits<SizeValueType>::max());
110 itkGetConstMacro(NumberOfThresholds, SizeValueType);
112
115 itkGetConstMacro(LabelOffset, OutputPixelType);
117
119 itkSetMacro(ValleyEmphasis, bool);
120 itkGetConstReferenceMacro(ValleyEmphasis, bool);
121 itkBooleanMacro(ValleyEmphasis);
123
126 itkSetMacro(ReturnBinMidpoint, bool);
127 itkGetConstReferenceMacro(ReturnBinMidpoint, bool);
128 itkBooleanMacro(ReturnBinMidpoint);
130
132 const ThresholdVectorType &
134 {
135 return m_Thresholds;
136 }
137
139 itkConceptMacro(OutputOStreamWritableCheck, (Concept::OStreamWritable<OutputPixelType>));
140
141protected:
144 void
145 PrintSelf(std::ostream & os, Indent indent) const override;
146
147 void
149
150 void
151 GenerateData() override;
152
153private:
158 bool m_ValleyEmphasis{ false };
159 bool m_ReturnBinMidpoint{ false };
160};
161} // end namespace itk
162
163#ifndef ITK_MANUAL_INSTANTIATION
164# include "itkOtsuMultipleThresholdsImageFilter.hxx"
165#endif
166
167#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
static constexpr T max(const T &)
Computes Otsu's multiple thresholds for a histogram.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
OtsuMultipleThresholdsCalculator< HistogramType > OtsuCalculatorType
~OtsuMultipleThresholdsImageFilter() override=default
typename HistogramGeneratorType::HistogramType HistogramType
itk::Statistics::ScalarImageToHistogramGenerator< TInputImage > HistogramGeneratorType
typename OtsuCalculatorType::OutputType ThresholdVectorType
void PrintSelf(std::ostream &os, Indent indent) const override
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86