Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkAnchorOpenCloseImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAnchorOpenCloseImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-20 16:32:08 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkAnchorOpenCloseImageFilter_h
00019 #define __itkAnchorOpenCloseImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkProgressReporter.h"
00023 #include "itkAnchorOpenCloseLine.h"
00024 #include "itkAnchorErodeDilateLine.h"
00025 #include "itkBresenhamLine.h"
00026 
00027 namespace itk {
00028 
00049 template<class TImage, class TKernel, 
00050          class LessThan, class GreaterThan, class LessEqual, class GreaterEqual>
00051 //          class THistogramCompare,
00052 //          class TFunction1, class TFunction2>
00053 class ITK_EXPORT AnchorOpenCloseImageFilter :
00054     public ImageToImageFilter<TImage, TImage>
00055 {
00056 public:
00057 
00059   typedef AnchorOpenCloseImageFilter               Self;
00060   typedef ImageToImageFilter<TImage, TImage>       Superclass;
00061   typedef SmartPointer<Self>                       Pointer;
00062   typedef SmartPointer<const Self>                 ConstPointer;
00063 
00067   typedef TKernel                                  KernelType;
00068   typedef typename KernelType::LType               KernelLType;
00069 
00070   typedef TImage                                   InputImageType;
00071   typedef typename InputImageType::Pointer         InputImagePointer;
00072   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00073   typedef typename InputImageType::RegionType      InputImageRegionType;
00074   typedef typename InputImageType::PixelType       InputImagePixelType;
00075 
00077   itkStaticConstMacro(InputImageDimension, unsigned int,
00078                       TImage::ImageDimension);
00079   itkStaticConstMacro(OutputImageDimension, unsigned int,
00080                       TImage::ImageDimension);
00082 
00084   itkNewMacro(Self);
00085 
00087   itkTypeMacro(AnchorOpenCloseImageFilter,
00088                ImageToImageFilter);
00089 
00090   void SetKernel( const KernelType& kernel )
00091     {
00092     m_Kernel=kernel;
00093     m_KernelSet = true;
00094     }
00095 
00096 protected:
00097   AnchorOpenCloseImageFilter();
00098   ~AnchorOpenCloseImageFilter() {};
00099   void PrintSelf(std::ostream& os, Indent indent) const;
00100 
00102   void  ThreadedGenerateData (const InputImageRegionType& outputRegionForThread,
00103                               int threadId);
00104 
00110   void GenerateInputRequestedRegion();
00111 
00112   InputImagePixelType m_Boundary1, m_Boundary2;
00113 
00114 private:
00115   AnchorOpenCloseImageFilter(const Self&); //purposely not implemented
00116   void operator=(const Self&); //purposely not implemented
00117 
00118   TKernel m_Kernel;
00119   bool    m_KernelSet;
00120   typedef BresenhamLine<itkGetStaticConstMacro(InputImageDimension)>  BresType;
00121   typedef typename BresType::OffsetArray                              BresOffsetArray;
00122 
00123   // the class that operates on lines -- does the opening in one
00124   // operation. The classes following are named on the assumption that
00125   // we are doing an opening
00126   
00127 //  typedef AnchorOpenCloseLine<InputImagePixelType, THistogramCompare, TFunction1, TFunction2> AnchorLineOpenType;
00128   typedef AnchorOpenCloseLine<InputImagePixelType, LessThan, GreaterEqual, LessEqual> AnchorLineOpenType;
00129 
00130   typedef AnchorErodeDilateLine<InputImagePixelType, LessThan, LessEqual> AnchorLineErodeType;
00131   
00132   // the class that does the dilation
00133   typedef AnchorErodeDilateLine<InputImagePixelType, GreaterThan, GreaterEqual> AnchorLineDilateType;
00134 
00135   void DoFaceOpen(InputImageConstPointer input,
00136                   InputImagePointer output,
00137                   InputImagePixelType border,
00138                   KernelLType line,
00139                   AnchorLineOpenType &AnchorLineOpen,
00140                   const BresOffsetArray LineOffsets,
00141                   InputImagePixelType * outbuffer,
00142                   const InputImageRegionType AllImage, 
00143                   const InputImageRegionType face);
00144 
00145 
00146 }; // end of class
00147 
00148 
00149 } // end namespace itk
00150 
00151 
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkAnchorOpenCloseImageFilter.txx"
00154 #endif
00155 
00156 #endif
00157 

Generated at Sat Feb 28 11:57:26 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000