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 namespace itk
00028 {
00029
00039 template <class TPixelType>
00040 class ITK_EXPORT ConformalFlatteningMeshFilter :
00041 public MeshToMeshFilter< Mesh<TPixelType, 3>,Mesh<TPixelType, 3> >
00042 {
00043 public:
00045 typedef ConformalFlatteningMeshFilter Self;
00046 typedef Mesh< TPixelType, 3 > Mesh3DType;
00047
00048 typedef Mesh3DType TInputMesh;
00049 typedef Mesh3DType TOutputMesh;
00050 typedef TInputMesh InputMeshType;
00051 typedef TOutputMesh OutputMeshType;
00052
00053 typedef MeshToMeshFilter<TInputMesh,TOutputMesh> Superclass;
00054
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00058 typedef typename InputMeshType::Pointer InputMeshPointer;
00059 typedef typename OutputMeshType::Pointer OutputMeshPointer;
00060 typedef typename InputMeshType::PointType InputPointType;
00061 typedef typename OutputMeshType::PointType OutputPointType;
00062
00064
00065 typedef double CoordRepType;
00066
00068 itkNewMacro(Self);
00069
00071 itkTypeMacro(ConformalFlatteningMeshFilter,MeshToMeshFilter);
00072
00073 void SetInput(TInputMesh *input);
00074
00076 itkStaticConstMacro(InputPointDimension, unsigned int,
00077 ::itk::GetMeshDimension< TInputMesh >::PointDimension );
00078 itkStaticConstMacro(OutputPointDimension, unsigned int,
00079 ::itk::GetMeshDimension< TOutputMesh >::PointDimension );
00081
00082 typedef typename InputMeshType::PointsContainer PointsContainer;
00083 typedef typename InputMeshType::CellsContainer CellsContainer;
00084 typedef typename InputMeshType::PointIdentifier PointIdentifier;
00085 typedef typename InputMeshType::CellIdentifier CellIdentifier;
00086 typedef typename PointsContainer::ConstIterator PointIterator;
00087 typedef typename CellsContainer::ConstIterator CellIterator;
00088 typedef typename InputMeshType::CellType CellType;
00089 typedef typename CellType::PointIdIterator PointIdIterator;
00090 typedef typename CellType::CellAutoPointer CellAutoPointer;
00091
00097 void SetPolarCellIdentifier( CellIdentifier cellId );
00098
00101 void SetScale( double );
00102
00104 void MapToSphere( void );
00105
00108 void MapToPlane( void );
00109
00110 protected:
00111 ConformalFlatteningMeshFilter();
00112 ~ConformalFlatteningMeshFilter() {};
00113 void PrintSelf(std::ostream& os, Indent indent) const;
00114
00116 virtual void GenerateData( void );
00117
00118 private:
00119
00120 ConformalFlatteningMeshFilter(const ConformalFlatteningMeshFilter&);
00121
00122 void operator=(const ConformalFlatteningMeshFilter&);
00123
00124 typedef vnl_vector< CoordRepType > VectorCoordType;
00125 typedef vnl_sparse_matrix<CoordRepType> SparseMatrixCoordType;
00126
00129 unsigned int m_PolarCellIdentifier;
00130
00132 bool m_MapToSphere;
00133
00136 double m_MapScale;
00137 };
00138
00139 }
00140
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkConformalFlatteningMeshFilter.txx"
00143 #endif
00144
00145 #endif
00146