ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkOpeningByReconstructionImageFilter.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 __itkOpeningByReconstructionImageFilter_h
00019 #define __itkOpeningByReconstructionImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00054 template< class TInputImage, class TOutputImage, class TKernel >
00055 class ITK_EXPORT OpeningByReconstructionImageFilter:
00056   public ImageToImageFilter< TInputImage, TOutputImage >
00057 {
00058 public:
00060   typedef OpeningByReconstructionImageFilter              Self;
00061   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00062   typedef SmartPointer< Self >                            Pointer;
00063   typedef SmartPointer< const Self >                      ConstPointer;
00064 
00066   typedef TInputImage                            InputImageType;
00067   typedef typename InputImageType::Pointer       InputImagePointer;
00068   typedef typename InputImageType::ConstPointer  InputImageConstPointer;
00069   typedef typename InputImageType::RegionType    InputImageRegionType;
00070   typedef typename InputImageType::PixelType     InputImagePixelType;
00071   typedef TOutputImage                           OutputImageType;
00072   typedef typename OutputImageType::Pointer      OutputImagePointer;
00073   typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00074   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00075   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00076 
00078   typedef TKernel KernelType;
00079 
00081   itkStaticConstMacro(InputImageDimension, unsigned int,
00082                       TInputImage::ImageDimension);
00083   itkStaticConstMacro(OutputImageDimension, unsigned int,
00084                       TOutputImage::ImageDimension);
00086 
00088   itkNewMacro(Self);
00089 
00091   itkTypeMacro(OpeningByReconstructionImageFilter,
00092                ImageToImageFilter);
00093 
00095   itkSetMacro(Kernel, KernelType);
00096 
00098   itkGetConstReferenceMacro(Kernel, KernelType);
00099 
00106   itkSetMacro(FullyConnected, bool);
00107   itkGetConstReferenceMacro(FullyConnected, bool);
00108   itkBooleanMacro(FullyConnected);
00110 
00115   itkSetMacro(PreserveIntensities, bool);
00116   itkGetConstReferenceMacro(PreserveIntensities, bool);
00117   itkBooleanMacro(PreserveIntensities);
00119 
00120 #ifdef ITK_USE_CONCEPT_CHECKING
00121 
00122   itkConceptMacro( InputEqualityComparableCheck,
00123                    ( Concept::EqualityComparable< InputImagePixelType > ) );
00124 
00126 #endif
00127 protected:
00128   OpeningByReconstructionImageFilter();
00129   ~OpeningByReconstructionImageFilter() {}
00130   void PrintSelf(std::ostream & os, Indent indent) const;
00132 
00136   void GenerateInputRequestedRegion();
00137 
00139   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00140 
00141   void GenerateData();
00142 
00143 private:
00144   OpeningByReconstructionImageFilter(const Self &); //purposely not implemented
00145   void operator=(const Self &);                     //purposely not implemented
00146 
00148   KernelType m_Kernel;
00149   bool       m_FullyConnected;
00150   bool       m_PreserveIntensities;
00151 }; // end of class
00152 } // end namespace itk
00153 
00154 #ifndef ITK_MANUAL_INSTANTIATION
00155 #include "itkOpeningByReconstructionImageFilter.hxx"
00156 #endif
00157 
00158 #endif
00159