ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBlackTopHatImageFilter.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 #ifndef __itkBlackTopHatImageFilter_h
00019 #define __itkBlackTopHatImageFilter_h
00020 
00021 #include "itkKernelImageFilter.h"
00022 
00023 namespace itk
00024 {
00041 template< class TInputImage, class TOutputImage, class TKernel >
00042 class ITK_EXPORT BlackTopHatImageFilter:
00043   public KernelImageFilter< TInputImage, TOutputImage, TKernel >
00044 {
00045 public:
00047   typedef BlackTopHatImageFilter                                  Self;
00048   typedef KernelImageFilter< TInputImage, TOutputImage, TKernel > Superclass;
00049   typedef SmartPointer< Self >                                    Pointer;
00050   typedef SmartPointer< const Self >                              ConstPointer;
00051 
00053   typedef TInputImage                            InputImageType;
00054   typedef TOutputImage                           OutputImageType;
00055   typedef typename InputImageType::Pointer       InputImagePointer;
00056   typedef typename InputImageType::ConstPointer  InputImageConstPointer;
00057   typedef typename InputImageType::RegionType    InputImageRegionType;
00058   typedef typename InputImageType::PixelType     InputImagePixelType;
00059   typedef typename OutputImageType::Pointer      OutputImagePointer;
00060   typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00061   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00062   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00063 
00065   typedef TKernel KernelType;
00066 
00068   itkStaticConstMacro(InputImageDimension, unsigned int,
00069                       TInputImage::ImageDimension);
00070   itkStaticConstMacro(OutputImageDimension, unsigned int,
00071                       TOutputImage::ImageDimension);
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(BlackTopHatImageFilter,
00079                KernelImageFilter);
00080 
00083   itkSetMacro(SafeBorder, bool);
00084   itkGetConstReferenceMacro(SafeBorder, bool);
00085   itkBooleanMacro(SafeBorder);
00087 
00089   enum {
00090     BASIC = 0,
00091     HISTO = 1,
00092     ANCHOR = 2,
00093     VHGW = 3
00094     } AlgorithmChoice;
00095 
00097   itkSetMacro(Algorithm, int);
00098   itkGetConstMacro(Algorithm, int);
00100 
00101   itkSetMacro(ForceAlgorithm, bool);
00102   itkGetConstReferenceMacro(ForceAlgorithm, bool);
00103   itkBooleanMacro(ForceAlgorithm);
00104 protected:
00105   BlackTopHatImageFilter();
00106   ~BlackTopHatImageFilter() {}
00107   void PrintSelf(std::ostream & os, Indent indent) const;
00108 
00109   void GenerateData();
00110 
00111 private:
00112   BlackTopHatImageFilter(const Self &); //purposely not implemented
00113   void operator=(const Self &);         //purposely not implemented
00114 
00115   bool m_SafeBorder;
00116 
00117   int m_Algorithm;
00118 
00119   bool m_ForceAlgorithm;
00120 }; // end of class
00121 } // end namespace itk
00122 
00123 #ifndef ITK_MANUAL_INSTANTIATION
00124 #include "itkBlackTopHatImageFilter.hxx"
00125 #endif
00126 
00127 #endif
00128