ITK  4.0.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 
00051 template<class TInputImage, class TOutputImage>
00052 class ITK_EXPORT OtsuThresholdImageFilter :
00053     public HistogramThresholdImageFilter<TInputImage, TOutputImage>
00054 {
00055 public:
00057   typedef OtsuThresholdImageFilter                                    Self;
00058   typedef HistogramThresholdImageFilter<TInputImage,TOutputImage>     Superclass;
00059   typedef SmartPointer<Self>                                          Pointer;
00060   typedef SmartPointer<const Self>                                    ConstPointer;
00061 
00063   itkNewMacro(Self);
00064 
00066   itkTypeMacro(OtsuThresholdImageFilter, HistogramThresholdImageFilter);
00067 
00068   typedef TInputImage                       InputImageType;
00069   typedef TOutputImage                      OutputImageType;
00070 
00072   typedef typename InputImageType::PixelType   InputPixelType;
00073   typedef typename OutputImageType::PixelType  OutputPixelType;
00074 
00076   typedef typename InputImageType::Pointer  InputImagePointer;
00077   typedef typename OutputImageType::Pointer OutputImagePointer;
00078 
00079   typedef typename InputImageType::SizeType    InputSizeType;
00080   typedef typename InputImageType::IndexType   InputIndexType;
00081   typedef typename InputImageType::RegionType  InputImageRegionType;
00082   typedef typename OutputImageType::SizeType   OutputSizeType;
00083   typedef typename OutputImageType::IndexType  OutputIndexType;
00084   typedef typename OutputImageType::RegionType OutputImageRegionType;
00085 
00086   typedef typename Superclass::HistogramType                          HistogramType;
00087   typedef OtsuThresholdCalculator< HistogramType, InputPixelType > CalculatorType;
00088 
00090   itkStaticConstMacro(InputImageDimension, unsigned int,
00091                       InputImageType::ImageDimension );
00092   itkStaticConstMacro(OutputImageDimension, unsigned int,
00093                       OutputImageType::ImageDimension );
00095 
00096 protected:
00097   OtsuThresholdImageFilter()
00098     {
00099     this->SetCalculator( CalculatorType::New() );
00100     }
00101   ~OtsuThresholdImageFilter(){};
00102 
00103 private:
00104   OtsuThresholdImageFilter(const Self&); //purposely not implemented
00105   void operator=(const Self&); //purposely not implemented
00106 }; // end of class
00107 
00108 } // end namespace itk
00109 
00110 #endif
00111