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

itkFlatStructuringElement.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFlatStructuringElement.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-12-06 13:28:10 $
00007   Version:   $Revision: 1.16 $
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 __itkFlatStructuringElement_h
00019 #define __itkFlatStructuringElement_h
00020 
00021 #include "itkNeighborhood.h"
00022 #include "itkSize.h"
00023 #include "itkOffset.h"
00024 #include <vector>
00025 #include "itkVector.h"
00026 
00027 namespace itk {
00028 
00041 template<unsigned int VDimension>
00042 class ITK_EXPORT FlatStructuringElement : public Neighborhood <bool, VDimension>
00043 {
00044 public:
00046   typedef FlatStructuringElement< VDimension>    Self;
00047   typedef Neighborhood<bool, VDimension>         Superclass;
00048 
00050   typedef typename Superclass::PixelType         PixelType;
00051 
00055   typedef typename Superclass::Iterator          Iterator;
00056   typedef typename Superclass::ConstIterator     ConstIterator;
00057 
00059   typedef typename Superclass::SizeType          SizeType;
00060   typedef typename Superclass::SizeValueType     SizeValueType;
00061   typedef typename Superclass::OffsetType        OffsetType;
00062 
00064   typedef typename Superclass::RadiusType        RadiusType;
00065 
00067   typedef typename Superclass::SliceIteratorType SliceIteratorType;
00068 
00070   itkStaticConstMacro(NeighborhoodDimension, unsigned int, VDimension);
00071 
00072   typedef Vector<float, VDimension>              LType;
00073   typedef std::vector<LType>                     DecompType;
00074 
00076   virtual ~FlatStructuringElement() {}
00077 
00079   FlatStructuringElement() {m_Decomposable=false;}
00080 
00087   static Self Box(RadiusType radius);
00088 
00090   static Self Ball(RadiusType radius);
00091 
00093   static Self Cross( RadiusType radius );
00094 
00096   static Self Annulus( RadiusType radius,
00097                        unsigned int thickness = 1,
00098                        bool includeCenter = false );
00099 
00105   static Self Poly(RadiusType radius, unsigned lines);
00106 
00112   bool GetDecomposable() const
00113     {
00114     return m_Decomposable;
00115     }
00116 
00118   const DecompType & GetLines() const
00119     {
00120     return(m_Lines);
00121     }
00122 
00123   void PrintSelf(std::ostream &os, Indent indent) const;
00124 
00125    
00126 protected:
00127 
00132   void ComputeBufferFromLines();
00133 
00134 
00135 private:
00136   bool m_Decomposable;
00137 
00138   DecompType m_Lines;
00139   
00140   // dispatch between 2D and 3D
00141   struct DispatchBase {};
00142   template<unsigned int VDimension2>
00143   struct Dispatch : DispatchBase {};
00144 
00145   virtual FlatStructuringElement PolySub(const Dispatch<2> &, 
00146                                          RadiusType radius, 
00147                                          unsigned lines) const;
00148 
00149   virtual FlatStructuringElement PolySub(const Dispatch<3> &, 
00150                                          RadiusType radius, 
00151                                          unsigned lines) const;
00152 
00153   virtual FlatStructuringElement PolySub(const DispatchBase &, 
00154                                          RadiusType radius, 
00155                                          unsigned lines) const;
00156 
00157 
00158   bool checkParallel(LType NewVec, DecompType Lines);
00159 
00160   template<unsigned int VDimension3>
00161   struct StructuringElementFacet
00162     {
00163     LType P1, P2, P3;
00164     };
00165   typedef StructuringElementFacet<VDimension> FacetType;
00166 };
00167 } // namespace itk
00168 
00169 #ifndef ITK_MANUAL_INSTANTIATION
00170 #include "itkFlatStructuringElement.txx"
00171 #endif
00172 
00173 
00174 #endif
00175 

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