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

itkQuadEdgeMeshBorderTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuadEdgeMeshBorderTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-09-30 21:34:45 $
00007   Version:   $Revision: 1.3 $
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 __itkQuadEdgeMeshBorderTransform_h
00019 #define __itkQuadEdgeMeshBorderTransform_h
00020 
00021 #include <itkQuadEdgeMesh.h>
00022 #include <itkQuadEdgeMeshToQuadEdgeMeshFilter.h>
00023 #include <itkQuadEdgeMeshBoundaryEdgesMeshFunction.h>
00024 
00025 namespace itk
00026 {
00034 template< class TInputMesh, class TOutputMesh >
00035 class QuadEdgeMeshBorderTransform :
00036        public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
00037 {
00038 public:
00039 
00041   typedef QuadEdgeMeshBorderTransform                   Self;
00042   typedef QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
00043     TOutputMesh >                                       Superclass;
00044   typedef SmartPointer< Self >                          Pointer;
00045   typedef SmartPointer< const Self >                    ConstPointer;
00046 
00047   typedef TInputMesh                                    InputMeshType;
00048   typedef typename InputMeshType::Pointer               InputMeshPointer;
00049   typedef typename InputMeshType::CoordRepType          InputCoordRepType;
00050   typedef typename InputMeshType::PointType             InputPointType;
00051   typedef typename InputMeshType::Traits                InputTraits;
00052   typedef typename InputMeshType::PointIdentifier       InputPointIdentifier;
00053   typedef typename InputMeshType::QEType                InputQEType;
00054   typedef typename InputQEType::IteratorGeom            InputIteratorGeom;
00055   typedef typename InputMeshType::VectorType            InputVectorType;
00056   typedef typename InputMeshType::EdgeListType          InputEdgeListType;
00057   typedef typename InputMeshType::EdgeListPointerType   InputEdgeListPointerType;
00058   typedef typename InputEdgeListType::iterator          InputEdgeListIterator;
00059   typedef typename InputMeshType::EdgeCellType          InputEdgeCellType;
00060   typedef typename InputMeshType::PolygonCellType       InputPolygonCellType;
00061   typedef typename InputMeshType::PointIdList           InputPointIdList;
00062   typedef typename InputMeshType::PointsContainer       InputPointsContainer;
00063   typedef typename InputMeshType::PointsContainerConstIterator
00064                                                         InputPointsContainerConstIterator;
00065   typedef typename InputMeshType::CellsContainerConstIterator
00066                                                         InputCellsContainerConstIterator;
00067 
00068   typedef TOutputMesh                                   OutputMeshType;
00069   typedef typename OutputMeshType::Pointer              OutputMeshPointer;
00070   typedef typename OutputMeshType::CoordRepType         OutputCoordRepType;
00071   typedef typename OutputMeshType::PointType            OutputPointType;
00072   typedef typename OutputMeshType::Traits               OutputTraits;
00073   typedef typename OutputMeshType::PointIdentifier      OutputPointIdentifier;
00074   typedef typename OutputMeshType::QEType               OutputQEType;
00075   typedef typename OutputMeshType::VectorType           OutputVectorType;
00076   typedef typename OutputMeshType::EdgeListType         OutputEdgeListType;
00077   typedef typename OutputMeshType::EdgeCellType         OutputEdgeCellType;
00078   typedef typename OutputMeshType::PolygonCellType      OutputPolygonCellType;
00079   typedef typename OutputMeshType::PointIdList          OutputPointIdList;
00080   typedef typename OutputMeshType::PointsContainer      OutputPointsContainer;
00081   typedef typename OutputMeshType::PointsContainerConstIterator
00082                                                         OutputPointsContainerConstIterator;
00083   typedef typename OutputMeshType::CellsContainerConstIterator
00084                                                         OutputCellsContainerConstIterator;
00085 
00086   itkNewMacro( Self );
00087   itkTypeMacro( QuadEdgeMeshBorderTransform, QuadEdgeMeshToQuadEdgeMeshFilter );
00088   itkStaticConstMacro( PointDimension, unsigned int, 
00089      InputTraits::PointDimension );
00090   
00091   typedef std::vector< InputPointType >                             InputVectorPointType;
00092   typedef std::map< InputPointIdentifier, OutputPointIdentifier >   MapPointIdentifier;
00093   typedef typename MapPointIdentifier::iterator                     MapPointIdentifierIterator;
00094 
00095   typedef QuadEdgeMeshBoundaryEdgesMeshFunction< InputMeshType >    BoundaryRepresentativeEdgesType;
00096   typedef typename BoundaryRepresentativeEdgesType::Pointer         BoundaryRepresentativeEdgesPointer;
00097 
00098 public:
00099 
00100   enum BorderTransformType 
00101     {
00102     SQUARE_BORDER_TRANSFORM = 0,
00103     DISK_BORDER_TRANSFORM
00104     };
00105 
00106   itkSetMacro( TransformType, BorderTransformType );
00107   itkGetMacro( TransformType, BorderTransformType );
00108 
00109   void ComputeTransform( );
00110   MapPointIdentifier GetBoundaryPtMap( );
00111   InputVectorPointType GetBorder( );
00112 
00113 protected:
00114   QuadEdgeMeshBorderTransform( );
00115   ~QuadEdgeMeshBorderTransform( ) {};
00116 
00117   BorderTransformType m_TransformType;
00118 
00119   InputCoordRepType         m_Radius;
00120   InputVectorPointType      m_Border;
00121 
00122   MapPointIdentifier   m_BoundaryPtMap;
00123 
00124   void GenerateData( );
00125   void ComputeBoundary( );
00126 
00127   InputEdgeListIterator ComputeLongestBorder( );
00128   InputEdgeListIterator ComputeLargestBorder( );
00129 
00130 
00131   void DiskTransform( );
00132   InputPointType GetMeshBarycentre( );
00133   InputCoordRepType RadiusMaxSquare( );
00134 
00135   void ArcLengthSquareTransform( );
00136 
00137 private:
00139   QuadEdgeMeshBorderTransform( const Self& );
00140 
00142   void operator = ( const Self& );
00143 
00144 };
00145 }
00146 #include "itkQuadEdgeMeshBorderTransform.txx"
00147 
00148 #endif
00149 

Generated at Wed Nov 5 23:36:21 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000