ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkIntermodesThresholdImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
19 #ifndef itkIntermodesThresholdImageFilter_h
20 #define itkIntermodesThresholdImageFilter_h
21 
24 
25 namespace itk
26 {
27 
51 template<typename TInputImage, typename TOutputImage, typename TMaskImage=TOutputImage>
53  public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(IntermodesThresholdImageFilter);
57 
63 
65  itkNewMacro(Self);
66 
69 
70  using InputImageType = TInputImage;
71  using OutputImageType = TOutputImage;
72  using MaskImageType = TMaskImage;
73 
75  using InputPixelType = typename InputImageType::PixelType;
76  using OutputPixelType = typename OutputImageType::PixelType;
77  using MaskPixelType = typename MaskImageType::PixelType;
78 
80  using InputImagePointer = typename InputImageType::Pointer;
81  using OutputImagePointer = typename OutputImageType::Pointer;
82 
92 
95 
96  void SetMaximumSmoothingIterations(SizeValueType maxSmoothingIterations)
97  {
98  m_IntermodesCalculator->SetMaximumSmoothingIterations(maxSmoothingIterations);
99  }
100 
102  {
103  return(m_IntermodesCalculator->GetMaximumSmoothingIterations());
104  }
105 
108  void SetUseInterMode(bool useIntermode)
109  {
110  m_IntermodesCalculator->SetUseInterMode(useIntermode);
111  }
112 
114  {
115  return(m_IntermodesCalculator->GetUseInterMode());
116  }
117 
119  static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
120  static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
121 
122 protected:
123 
125  {
128  m_IntermodesCalculator->SetMaximumSmoothingIterations(10000);
129  m_IntermodesCalculator->SetUseInterMode(true);
130  }
131  ~IntermodesThresholdImageFilter() override = default;
132 
133  void PrintSelf(std::ostream & os, Indent indent) const override
134  {
135  Superclass::PrintSelf(os, indent);
136 
137  itkPrintSelfObjectMacro( IntermodesCalculator );
138  }
139 
140 private:
142 
143 };
144 
145 } // end namespace itk
146 
147 #endif
~IntermodesThresholdImageFilter() override=default
Threshold an image using a HistogramThresholdCalculator.
typename OutputImageType::Pointer OutputImagePointer
typename MaskImageType::SizeType MaskSizeType
void SetMaximumSmoothingIterations(SizeValueType maxSmoothingIterations)
unsigned long SizeValueType
Definition: itkIntTypes.h:83
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
virtual void SetCalculator(CalculatorType *_arg)
Computes the Intermodes&#39;s threshold for an image.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename MaskImageType::PixelType MaskPixelType
typename InputImageType::SizeType InputSizeType
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::SizeType OutputSizeType
TOutputImage OutputImageType
typename MaskImageType::RegionType MaskImageRegionType
typename InputImageType::IndexType InputIndexType
typename MaskImageType::IndexType MaskIndexType
Threshold an image using the Intermodes Threshold.
typename InputImageType::RegionType InputImageRegionType
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Statistics::Histogram< ValueRealType > HistogramType
Base class to compute a threshold value based on the histogram of an image.
typename OutputImageType::PixelType OutputPixelType
typename OutputImageType::IndexType OutputIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
typename InputImageType::PixelType InputPixelType