00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkConformalFlatteningMeshFilter_h
00018 #define __itkConformalFlatteningMeshFilter_h
00019
00020 #include "itkMesh.h"
00021 #include "itkMeshToMeshFilter.h"
00022
00023
00024 #include <vnl/vnl_math.h>
00025 #include <vnl/vnl_sparse_matrix.h>
00026
00027
00028
00029 namespace itk
00030 {
00031
00041 template <class TInputMesh, class TOutputMesh>
00042 class ITK_EXPORT ConformalFlatteningMeshFilter :
00043 public MeshToMeshFilter<TInputMesh, TOutputMesh>
00044 {
00045 public:
00047 typedef ConformalFlatteningMeshFilter Self;
00048
00049 typedef TInputMesh InputMeshType;
00050 typedef TOutputMesh OutputMeshType;
00051
00052 typedef MeshToMeshFilter<TInputMesh,TOutputMesh> Superclass;
00053
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00057 typedef typename InputMeshType::Pointer InputMeshPointer;
00058 typedef typename OutputMeshType::Pointer OutputMeshPointer;
00059 typedef typename InputMeshType::PointType InputPointType;
00060 typedef typename OutputMeshType::PointType OutputPointType;
00061
00063
00064 typedef double CoordRepType;
00065
00067 itkNewMacro(Self);
00068
00070 itkTypeMacro(ConformalFlatteningMeshFilter,MeshToMeshFilter);
00071
00072 void SetInput(TInputMesh *input);
00073
00075 itkStaticConstMacro(InputPointDimension, unsigned int,
00076 ::itk::GetMeshDimension< TInputMesh >::PointDimension );
00077 itkStaticConstMacro(OutputPointDimension, unsigned int,
00078 ::itk::GetMeshDimension< TOutputMesh >::PointDimension );
00080
00081 typedef typename InputMeshType::PointsContainer PointsContainer;
00082 typedef typename InputMeshType::CellsContainer CellsContainer;
00083 typedef typename InputMeshType::PointIdentifier PointIdentifier;
00084 typedef typename InputMeshType::CellIdentifier CellIdentifier;
00085 typedef typename PointsContainer::ConstIterator PointIterator;
00086 typedef typename CellsContainer::ConstIterator CellIterator;
00087 typedef typename InputMeshType::CellType CellType;
00088 typedef typename CellType::PointIdIterator PointIdIterator;
00089 typedef typename CellType::CellAutoPointer CellAutoPointer;
00090
00096 void SetPolarCellIdentifier( CellIdentifier cellId );
00097
00100 void SetScale( double );
00101
00103 void MapToSphere( void );
00104
00107 void MapToPlane( void );
00108
00109 protected:
00110 ConformalFlatteningMeshFilter();
00111 ~ConformalFlatteningMeshFilter() {};
00112 void PrintSelf(std::ostream& os, Indent indent) const;
00113
00115 virtual void GenerateData( void );
00116
00117 private:
00118
00119 ConformalFlatteningMeshFilter(const ConformalFlatteningMeshFilter&);
00120
00121 void operator=(const ConformalFlatteningMeshFilter&);
00122
00123 typedef vnl_vector< CoordRepType > VectorCoordType;
00124 typedef vnl_sparse_matrix<CoordRepType> SparseMatrixCoordType;
00125
00128 unsigned int m_PolarCellIdentifier;
00129
00131 bool m_MapToSphere;
00132
00135 double m_MapScale;
00136 };
00137
00138 }
00139
00140 #ifndef ITK_MANUAL_INSTANTIATION
00141 #include "itkConformalFlatteningMeshFilter.txx"
00142 #endif
00143
00144 #endif
00145