ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBinaryOpeningByReconstructionImageFilter.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 __itkBinaryOpeningByReconstructionImageFilter_h
00019 #define __itkBinaryOpeningByReconstructionImageFilter_h
00020 
00021 #include "itkKernelImageFilter.h"
00022 
00023 namespace itk {
00024 
00048 template<class TInputImage, class TKernel>
00049 class ITK_EXPORT BinaryOpeningByReconstructionImageFilter :
00050     public KernelImageFilter<TInputImage, TInputImage, TKernel>
00051 {
00052 public:
00054   typedef BinaryOpeningByReconstructionImageFilter     Self;
00055   typedef KernelImageFilter<TInputImage, TInputImage, TKernel>
00056                                                        Superclass;
00057   typedef SmartPointer<Self>                           Pointer;
00058   typedef SmartPointer<const Self>                     ConstPointer;
00059 
00061   itkNewMacro(Self);
00062 
00064   itkTypeMacro(BinaryOpeningByReconstructionImageFilter,
00065                KernelImageFilter);
00066 
00067   typedef TInputImage                              InputImageType;
00068   typedef TInputImage                              OutputImageType;
00069   typedef typename InputImageType::Pointer         InputImagePointer;
00070   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00071 
00073   typedef typename TInputImage::PixelType PixelType;
00074 
00076   typedef TKernel KernelType;
00077 
00080   itkSetMacro(ForegroundValue, PixelType);
00081 
00084   itkGetMacro(ForegroundValue, PixelType);
00085 
00087   itkSetMacro(BackgroundValue, PixelType);
00088 
00090   itkGetMacro(BackgroundValue, PixelType);
00091 
00098   itkSetMacro(FullyConnected, bool);
00099   itkGetConstReferenceMacro(FullyConnected, bool);
00100   itkBooleanMacro(FullyConnected);
00102 
00103 
00104 protected:
00105   BinaryOpeningByReconstructionImageFilter();
00106   ~BinaryOpeningByReconstructionImageFilter() {};
00107   void PrintSelf(std::ostream& os, Indent indent) const;
00108 
00114   void GenerateInputRequestedRegion();
00115 
00118   void  GenerateData ();
00119 
00120 private:
00121   BinaryOpeningByReconstructionImageFilter(const Self&); //purposely not implemented
00122   void operator=(const Self&); //purposely not implemented
00123 
00124   PixelType  m_ForegroundValue;
00125 
00126   PixelType  m_BackgroundValue;
00127 
00128   bool       m_FullyConnected;
00129 
00130 }; // end of class
00131 
00132 } // end namespace itk
00133 
00134 #ifndef ITK_MANUAL_INSTANTIATION
00135 #include "itkBinaryOpeningByReconstructionImageFilter.hxx"
00136 #endif
00137 
00138 #endif
00139