00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 itkGetConstMacro( TransformType, BorderTransformType );
00108
00109 itkSetMacro( Radius, InputCoordRepType );
00110 itkGetConstMacro( Radius, InputCoordRepType );
00111
00112 void ComputeTransform( );
00113 MapPointIdentifier GetBoundaryPtMap( );
00114 InputVectorPointType GetBorder( );
00115
00116 protected:
00117 QuadEdgeMeshBorderTransform( );
00118 ~QuadEdgeMeshBorderTransform( ) {};
00119
00120 BorderTransformType m_TransformType;
00121
00122 InputCoordRepType m_Radius;
00123 InputVectorPointType m_Border;
00124
00125 MapPointIdentifier m_BoundaryPtMap;
00126
00127 void GenerateData( );
00128 void ComputeBoundary( );
00129
00130 InputEdgeListIterator ComputeLongestBorder( );
00131 InputEdgeListIterator ComputeLargestBorder( );
00132
00133
00134 void DiskTransform( );
00135 InputPointType GetMeshBarycentre( );
00136 InputCoordRepType RadiusMaxSquare( );
00137
00138 void ArcLengthSquareTransform( );
00139
00140 private:
00142 QuadEdgeMeshBorderTransform( const Self& );
00143
00145 void operator = ( const Self& );
00146
00147 };
00148 }
00149 #include "itkQuadEdgeMeshBorderTransform.txx"
00150
00151 #endif
00152