ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkConformalFlatteningMeshFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkConformalFlatteningMeshFilter_h
19 #define itkConformalFlatteningMeshFilter_h
20 
21 #include "itkMesh.h"
22 #include "itkMeshToMeshFilter.h"
23 
24 // vnl headers
25 #include "itkMath.h"
26 #include "vnl/vnl_sparse_matrix.h"
27 
28 
29 namespace itk
30 {
47 template< typename TInputMesh, typename TOutputMesh >
48 class ITK_TEMPLATE_EXPORT ConformalFlatteningMeshFilter:
49  public MeshToMeshFilter< TInputMesh, TOutputMesh >
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_ASSIGN(ConformalFlatteningMeshFilter);
53 
56 
57  using InputMeshType = TInputMesh;
58  using OutputMeshType = TOutputMesh;
59 
61 
64 
65  using InputMeshConstPointer = typename InputMeshType::ConstPointer;
66  using OutputMeshPointer = typename OutputMeshType::Pointer;
69 
71  //using CoordRepType = typename TInputMesh::CoordRepType;
72  using CoordRepType = double;
73 
75  itkNewMacro(Self);
76 
79 
81  static constexpr unsigned int InputPointDimension = TInputMesh::PointDimension;
82  static constexpr unsigned int OutputPointDimension = TOutputMesh::PointDimension;
83 
84  using PointsContainer = typename InputMeshType::PointsContainer;
85  using CellsContainer = typename InputMeshType::CellsContainer;
86  using PointIdentifier = typename InputMeshType::PointIdentifier;
87  using CellIdentifier = typename InputMeshType::CellIdentifier;
88  using PointIterator = typename PointsContainer::ConstIterator;
89  using CellIterator = typename CellsContainer::ConstIterator;
90  using CellType = typename InputMeshType::CellType;
91  using PointIdIterator = typename CellType::PointIdIterator;
92  using CellAutoPointer = typename CellType::CellAutoPointer;
93 
99  void SetPolarCellIdentifier(CellIdentifier cellId);
100 
103  void SetScale(double);
104 
106  void MapToSphere();
107 
110  void MapToPlane();
111 
112 protected:
115  void PrintSelf(std::ostream & os, Indent indent) const override;
116 
118  void GenerateData() override;
119 
120 private:
121  using VectorCoordType = vnl_vector< CoordRepType >;
122  using SparseMatrixCoordType = vnl_sparse_matrix< CoordRepType >;
123 
126  unsigned int m_PolarCellIdentifier;
127 
130 
133  double m_MapScale;
134 };
135 } // end namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkConformalFlatteningMeshFilter.hxx"
139 #endif
140 
141 #endif
Light weight base class for most itk classes.
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename CellType::CellAutoPointer CellAutoPointer
typename InputMeshType::CellsContainer CellsContainer
typename InputMeshType::PointType InputPointType
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
typename CellType::PointIdIterator PointIdIterator
ConformalFlatteningMeshFilter applies a conformal mapping from 3D to 2D.
typename OutputMeshType::PointType OutputPointType
typename CellsContainer::ConstIterator CellIterator
typename InputMeshType::PointIdentifier PointIdentifier
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
vnl_sparse_matrix< CoordRepType > SparseMatrixCoordType
typename InputMeshType::ConstPointer InputMeshConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename PointsContainer::ConstIterator PointIterator
typename InputMeshType::CellIdentifier CellIdentifier
typename InputMeshType::PointsContainer PointsContainer