ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkConformalFlatteningMeshFilter_h 00019 #define __itkConformalFlatteningMeshFilter_h 00020 00021 #include "itkMesh.h" 00022 #include "itkMeshToMeshFilter.h" 00023 00024 // vnl headers 00025 #include "vnl/vnl_math.h" 00026 #include "vnl/vnl_sparse_matrix.h" 00027 00028 00029 namespace itk 00030 { 00047 template< class TInputMesh, class TOutputMesh > 00048 class ITK_EXPORT ConformalFlatteningMeshFilter: 00049 public MeshToMeshFilter< TInputMesh, TOutputMesh > 00050 { 00051 public: 00053 typedef ConformalFlatteningMeshFilter Self; 00054 00055 typedef TInputMesh InputMeshType; 00056 typedef TOutputMesh OutputMeshType; 00057 00058 typedef MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass; 00059 00060 typedef SmartPointer< Self > Pointer; 00061 typedef SmartPointer< const Self > ConstPointer; 00062 00063 typedef typename InputMeshType::ConstPointer InputMeshConstPointer; 00064 typedef typename OutputMeshType::Pointer OutputMeshPointer; 00065 typedef typename InputMeshType::PointType InputPointType; 00066 typedef typename OutputMeshType::PointType OutputPointType; 00067 00069 //typedef typename TInputMesh::CoordRepType CoordRepType; 00070 typedef double CoordRepType; 00071 00073 itkNewMacro(Self); 00074 00076 itkTypeMacro(ConformalFlatteningMeshFilter, MeshToMeshFilter); 00077 00079 itkStaticConstMacro(InputPointDimension, unsigned int, 00080 ::itk::GetMeshDimension< TInputMesh >::PointDimension); 00081 itkStaticConstMacro(OutputPointDimension, unsigned int, 00082 ::itk::GetMeshDimension< TOutputMesh >::PointDimension); 00084 00085 typedef typename InputMeshType::PointsContainer PointsContainer; 00086 typedef typename InputMeshType::CellsContainer CellsContainer; 00087 typedef typename InputMeshType::PointIdentifier PointIdentifier; 00088 typedef typename InputMeshType::CellIdentifier CellIdentifier; 00089 typedef typename PointsContainer::ConstIterator PointIterator; 00090 typedef typename CellsContainer::ConstIterator CellIterator; 00091 typedef typename InputMeshType::CellType CellType; 00092 typedef typename CellType::PointIdIterator PointIdIterator; 00093 typedef typename CellType::CellAutoPointer CellAutoPointer; 00094 00100 void SetPolarCellIdentifier(CellIdentifier cellId); 00101 00104 void SetScale(double); 00105 00107 void MapToSphere(void); 00108 00111 void MapToPlane(void); 00112 00113 protected: 00114 ConformalFlatteningMeshFilter(); 00115 ~ConformalFlatteningMeshFilter() {} 00116 void PrintSelf(std::ostream & os, Indent indent) const; 00117 00119 virtual void GenerateData(void); 00120 00121 private: 00122 //purposely not implemented 00123 ConformalFlatteningMeshFilter(const ConformalFlatteningMeshFilter &); 00124 //purposely not implemented 00125 void operator=(const ConformalFlatteningMeshFilter &); 00126 00127 typedef vnl_vector< CoordRepType > VectorCoordType; 00128 typedef vnl_sparse_matrix< CoordRepType > SparseMatrixCoordType; 00129 00132 unsigned int m_PolarCellIdentifier; 00133 00135 bool m_MapToSphere; 00136 00139 double m_MapScale; 00140 }; 00141 } // end namespace itk 00142 00143 #ifndef ITK_MANUAL_INSTANTIATION 00144 #include "itkConformalFlatteningMeshFilter.hxx" 00145 #endif 00146 00147 #endif 00148