ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkOtsuThresholdImageFilter.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 __itkOtsuThresholdImageFilter_h
20 #define __itkOtsuThresholdImageFilter_h
21 
24 
25 namespace itk {
26 
53 template<class TInputImage, class TOutputImage, class TMaskImage=TOutputImage>
54 class ITK_EXPORT OtsuThresholdImageFilter :
55  public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>
56 {
57 public:
60  typedef HistogramThresholdImageFilter<TInputImage,TOutputImage,
61  TMaskImage> Superclass;
64 
66  itkNewMacro(Self);
67 
70 
71  typedef TInputImage InputImageType;
72  typedef TOutputImage OutputImageType;
73  typedef TMaskImage MaskImageType;
74 
76  typedef typename InputImageType::PixelType InputPixelType;
77  typedef typename OutputImageType::PixelType OutputPixelType;
78  typedef typename MaskImageType::PixelType MaskPixelType;
79 
81  typedef typename InputImageType::Pointer InputImagePointer;
82  typedef typename OutputImageType::Pointer OutputImagePointer;
83 
84  typedef typename InputImageType::SizeType InputSizeType;
85  typedef typename InputImageType::IndexType InputIndexType;
86  typedef typename InputImageType::RegionType InputImageRegionType;
87  typedef typename OutputImageType::SizeType OutputSizeType;
88  typedef typename OutputImageType::IndexType OutputIndexType;
89  typedef typename OutputImageType::RegionType OutputImageRegionType;
90  typedef typename MaskImageType::SizeType MaskSizeType;
91  typedef typename MaskImageType::IndexType MaskIndexType;
92  typedef typename MaskImageType::RegionType MaskImageRegionType;
93 
94  typedef typename Superclass::HistogramType HistogramType;
96 
98  itkStaticConstMacro(InputImageDimension, unsigned int,
99  InputImageType::ImageDimension );
100  itkStaticConstMacro(OutputImageDimension, unsigned int,
101  OutputImageType::ImageDimension );
103 
104 protected:
106  {
107  this->SetCalculator( CalculatorType::New() );
108  }
110 
111 private:
112  OtsuThresholdImageFilter(const Self&); //purposely not implemented
113  void operator=(const Self&); //purposely not implemented
114 }; // end of class
115 
116 } // end namespace itk
117 
118 #endif
119