ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkOtsuThresholdImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 
00019 #ifndef __itkOtsuThresholdImageFilter_h
00020 #define __itkOtsuThresholdImageFilter_h
00021 
00022 #include "itkHistogramThresholdImageFilter.h"
00023 #include "itkOtsuThresholdCalculator.h"
00024 
00025 namespace itk {
00026 
00053 template<class TInputImage, class TOutputImage, class TMaskImage=TOutputImage>
00054 class ITK_EXPORT OtsuThresholdImageFilter :
00055     public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>
00056 {
00057 public:
00059   typedef OtsuThresholdImageFilter                                    Self;
00060   typedef HistogramThresholdImageFilter<TInputImage,TOutputImage,
00061                                         TMaskImage>                   Superclass;
00062   typedef SmartPointer<Self>                                          Pointer;
00063   typedef SmartPointer<const Self>                                    ConstPointer;
00064 
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro(OtsuThresholdImageFilter, HistogramThresholdImageFilter);
00070 
00071   typedef TInputImage                       InputImageType;
00072   typedef TOutputImage                      OutputImageType;
00073   typedef TMaskImage                        MaskImageType;
00074 
00076   typedef typename InputImageType::PixelType   InputPixelType;
00077   typedef typename OutputImageType::PixelType  OutputPixelType;
00078   typedef typename MaskImageType::PixelType    MaskPixelType;
00079 
00081   typedef typename InputImageType::Pointer  InputImagePointer;
00082   typedef typename OutputImageType::Pointer OutputImagePointer;
00083 
00084   typedef typename InputImageType::SizeType    InputSizeType;
00085   typedef typename InputImageType::IndexType   InputIndexType;
00086   typedef typename InputImageType::RegionType  InputImageRegionType;
00087   typedef typename OutputImageType::SizeType   OutputSizeType;
00088   typedef typename OutputImageType::IndexType  OutputIndexType;
00089   typedef typename OutputImageType::RegionType OutputImageRegionType;
00090   typedef typename MaskImageType::SizeType     MaskSizeType;
00091   typedef typename MaskImageType::IndexType    MaskIndexType;
00092   typedef typename MaskImageType::RegionType   MaskImageRegionType;
00093 
00094   typedef typename Superclass::HistogramType                          HistogramType;
00095   typedef OtsuThresholdCalculator< HistogramType, InputPixelType > CalculatorType;
00096 
00098   itkStaticConstMacro(InputImageDimension, unsigned int,
00099                       InputImageType::ImageDimension );
00100   itkStaticConstMacro(OutputImageDimension, unsigned int,
00101                       OutputImageType::ImageDimension );
00103 
00104 protected:
00105   OtsuThresholdImageFilter()
00106     {
00107     this->SetCalculator( CalculatorType::New() );
00108     }
00109   ~OtsuThresholdImageFilter(){};
00110 
00111 private:
00112   OtsuThresholdImageFilter(const Self&); //purposely not implemented
00113   void operator=(const Self&); //purposely not implemented
00114 }; // end of class
00115 
00116 } // end namespace itk
00117 
00118 #endif
00119