ITK  5.2.0
Insight Toolkit
itkConformalFlatteningMeshFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 : public MeshToMeshFilter<TInputMesh, TOutputMesh>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(ConformalFlatteningMeshFilter);
52 
55 
56  using InputMeshType = TInputMesh;
57  using OutputMeshType = TOutputMesh;
58 
60 
63 
64  using InputMeshConstPointer = typename InputMeshType::ConstPointer;
65  using OutputMeshPointer = typename OutputMeshType::Pointer;
68 
70  // using CoordRepType = typename TInputMesh::CoordRepType;
71  using CoordRepType = double;
72 
74  itkNewMacro(Self);
75 
78 
80  static constexpr unsigned int InputPointDimension = TInputMesh::PointDimension;
81  static constexpr unsigned int OutputPointDimension = TOutputMesh::PointDimension;
82 
83  using PointsContainer = typename InputMeshType::PointsContainer;
84  using CellsContainer = typename InputMeshType::CellsContainer;
85  using PointIdentifier = typename InputMeshType::PointIdentifier;
86  using CellIdentifier = typename InputMeshType::CellIdentifier;
87  using PointIterator = typename PointsContainer::ConstIterator;
88  using CellIterator = typename CellsContainer::ConstIterator;
89  using CellType = typename InputMeshType::CellType;
90  using PointIdIterator = typename CellType::PointIdIterator;
91  using CellAutoPointer = typename CellType::CellAutoPointer;
92 
98  void
99  SetPolarCellIdentifier(CellIdentifier cellId);
100 
103  void
104  SetScale(double);
105 
107  void
108  MapToSphere();
109 
112  void
113  MapToPlane();
114 
115 protected:
117  ~ConformalFlatteningMeshFilter() override = default;
118  void
119  PrintSelf(std::ostream & os, Indent indent) const override;
120 
122  void
123  GenerateData() override;
124 
125 private:
126  using VectorCoordType = vnl_vector<CoordRepType>;
127  using SparseMatrixCoordType = vnl_sparse_matrix<CoordRepType>;
128 
131  unsigned int m_PolarCellIdentifier;
132 
135 
138  double m_MapScale;
139 };
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 # include "itkConformalFlatteningMeshFilter.hxx"
144 #endif
145 
146 #endif
itk::ConformalFlatteningMeshFilter::m_MapScale
double m_MapScale
Definition: itkConformalFlatteningMeshFilter.h:138
itk::ConformalFlatteningMeshFilter::InputMeshConstPointer
typename InputMeshType::ConstPointer InputMeshConstPointer
Definition: itkConformalFlatteningMeshFilter.h:64
itk::ConformalFlatteningMeshFilter::SparseMatrixCoordType
vnl_sparse_matrix< CoordRepType > SparseMatrixCoordType
Definition: itkConformalFlatteningMeshFilter.h:127
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::ConformalFlatteningMeshFilter::CoordRepType
double CoordRepType
Definition: itkConformalFlatteningMeshFilter.h:71
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::ConformalFlatteningMeshFilter::m_MapToSphere
bool m_MapToSphere
Definition: itkConformalFlatteningMeshFilter.h:134
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ConformalFlatteningMeshFilter::CellsContainer
typename InputMeshType::CellsContainer CellsContainer
Definition: itkConformalFlatteningMeshFilter.h:84
itk::ConformalFlatteningMeshFilter::CellType
typename InputMeshType::CellType CellType
Definition: itkConformalFlatteningMeshFilter.h:89
itk::ConformalFlatteningMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkConformalFlatteningMeshFilter.h:67
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::ConformalFlatteningMeshFilter::PointIterator
typename PointsContainer::ConstIterator PointIterator
Definition: itkConformalFlatteningMeshFilter.h:87
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ConformalFlatteningMeshFilter::PointIdentifier
typename InputMeshType::PointIdentifier PointIdentifier
Definition: itkConformalFlatteningMeshFilter.h:85
itk::ConformalFlatteningMeshFilter::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkConformalFlatteningMeshFilter.h:66
itkMesh.h
itk::ConformalFlatteningMeshFilter::CellAutoPointer
typename CellType::CellAutoPointer CellAutoPointer
Definition: itkConformalFlatteningMeshFilter.h:91
itk::MeshToMeshFilter
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
Definition: itkMeshToMeshFilter.h:47
itk::ConformalFlatteningMeshFilter::CellIterator
typename CellsContainer::ConstIterator CellIterator
Definition: itkConformalFlatteningMeshFilter.h:88
itkMeshToMeshFilter.h
itk::ConformalFlatteningMeshFilter::VectorCoordType
vnl_vector< CoordRepType > VectorCoordType
Definition: itkConformalFlatteningMeshFilter.h:126
itk::ConformalFlatteningMeshFilter::m_PolarCellIdentifier
unsigned int m_PolarCellIdentifier
Definition: itkConformalFlatteningMeshFilter.h:131
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConformalFlatteningMeshFilter::PointIdIterator
typename CellType::PointIdIterator PointIdIterator
Definition: itkConformalFlatteningMeshFilter.h:90
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::ConformalFlatteningMeshFilter::PointsContainer
typename InputMeshType::PointsContainer PointsContainer
Definition: itkConformalFlatteningMeshFilter.h:83
itkMath.h
itk::ConformalFlatteningMeshFilter
ConformalFlatteningMeshFilter applies a conformal mapping from 3D to 2D.
Definition: itkConformalFlatteningMeshFilter.h:48
itk::ConformalFlatteningMeshFilter::CellIdentifier
typename InputMeshType::CellIdentifier CellIdentifier
Definition: itkConformalFlatteningMeshFilter.h:86