ITK  4.8.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 
50 template<typename TInputImage, typename TOutputImage, typename TMaskImage=TOutputImage>
52  public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>
53 {
54 public:
60 
62  itkNewMacro(Self);
63 
66 
67  typedef TInputImage InputImageType;
68  typedef TOutputImage OutputImageType;
69  typedef TMaskImage MaskImageType;
70 
72  typedef typename InputImageType::PixelType InputPixelType;
73  typedef typename OutputImageType::PixelType OutputPixelType;
74  typedef typename MaskImageType::PixelType MaskPixelType;
75 
77  typedef typename InputImageType::Pointer InputImagePointer;
78  typedef typename OutputImageType::Pointer OutputImagePointer;
79 
80  typedef typename InputImageType::SizeType InputSizeType;
81  typedef typename InputImageType::IndexType InputIndexType;
82  typedef typename InputImageType::RegionType InputImageRegionType;
83  typedef typename OutputImageType::SizeType OutputSizeType;
84  typedef typename OutputImageType::IndexType OutputIndexType;
85  typedef typename OutputImageType::RegionType OutputImageRegionType;
86  typedef typename MaskImageType::SizeType MaskSizeType;
87  typedef typename MaskImageType::IndexType MaskIndexType;
88  typedef typename MaskImageType::RegionType MaskImageRegionType;
89 
92 
93  void SetMaximumSmoothingIterations(unsigned long I)
94  {
95  m_IntermodesCalculator->SetMaximumSmoothingIterations(I);
96  }
97 
99  {
100  return(m_IntermodesCalculator->GetMaximumSmoothingIterations());
101  }
102 
105  void SetUseInterMode(unsigned long I)
106  {
107  m_IntermodesCalculator->SetUseInterMode(I);
108  }
109 
111  {
112  return(m_IntermodesCalculator->GetUseInterMode());
113  }
114 
116  itkStaticConstMacro(InputImageDimension, unsigned int,
117  InputImageType::ImageDimension );
118  itkStaticConstMacro(OutputImageDimension, unsigned int,
119  OutputImageType::ImageDimension );
121 
122 protected:
123 
125  {
128  m_IntermodesCalculator->SetMaximumSmoothingIterations(10000);
129  m_IntermodesCalculator->SetUseInterMode(true);
130  }
132 
133  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
134  {
135  Superclass::PrintSelf(os, indent);
136  os << indent << "MaximumSmoothingIterations: " << m_IntermodesCalculator->GetMaximumSmoothingIterations() << std::endl;
137  os << indent << "UseInterMode: " << m_IntermodesCalculator->GetUseInterMode() << std::endl;
138  }
139 
140 private:
141  IntermodesThresholdImageFilter(const Self&); //purposely not implemented
142  void operator=(const Self&); //purposely not implemented
143 
145 
146 }; // end of class
147 
148 } // end namespace itk
149 
150 #endif
Threshold an image using a HistogramThresholdCalculator.
Statistics::Histogram< ValueRealType > HistogramType
virtual void SetCalculator(CalculatorType *_arg)
Computes the Intermodes&#39;s threshold for an image.
Base class for all process objects that output image data.
HistogramThresholdImageFilter< TInputImage, TOutputImage, TMaskImage > Superclass
Threshold an image using the Intermodes Threshold.
IntermodesThresholdCalculator< HistogramType, InputPixelType > CalculatorType
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const override