ITK  5.4.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  * https://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 {
46 template <typename TInputMesh, typename TOutputMesh>
47 class ITK_TEMPLATE_EXPORT ConformalFlatteningMeshFilter : public MeshToMeshFilter<TInputMesh, TOutputMesh>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(ConformalFlatteningMeshFilter);
51 
54 
55  using InputMeshType = TInputMesh;
56  using OutputMeshType = TOutputMesh;
57 
59 
62 
67 
69  // using CoordRepType = typename TInputMesh::CoordRepType;
70  using CoordRepType = double;
71 
73  itkNewMacro(Self);
74 
76  itkOverrideGetNameOfClassMacro(ConformalFlatteningMeshFilter);
77 
79  static constexpr unsigned int InputPointDimension = TInputMesh::PointDimension;
80  static constexpr unsigned int OutputPointDimension = TOutputMesh::PointDimension;
81 
82  using PointsContainer = typename InputMeshType::PointsContainer;
83  using CellsContainer = typename InputMeshType::CellsContainer;
84  using PointIdentifier = typename InputMeshType::PointIdentifier;
85  using CellIdentifier = typename InputMeshType::CellIdentifier;
86  using PointIterator = typename PointsContainer::ConstIterator;
87  using CellIterator = typename CellsContainer::ConstIterator;
88  using CellType = typename InputMeshType::CellType;
89  using PointIdIterator = typename CellType::PointIdIterator;
90  using CellAutoPointer = typename CellType::CellAutoPointer;
91 
97  void
98  SetPolarCellIdentifier(CellIdentifier cellId);
99 
102  void
103  SetScale(double);
104 
106  void
107  MapToSphere();
108 
111  void
112  MapToPlane();
113 
114 protected:
116  ~ConformalFlatteningMeshFilter() override = default;
117  void
118  PrintSelf(std::ostream & os, Indent indent) const override;
119 
121  void
122  GenerateData() override;
123 
124 private:
125  using VectorCoordType = vnl_vector<CoordRepType>;
126  using SparseMatrixCoordType = vnl_sparse_matrix<CoordRepType>;
127 
130  unsigned int m_PolarCellIdentifier{};
131 
133  bool m_MapToSphere{};
134 
137  double m_MapScale{};
138 };
139 } // end namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 # include "itkConformalFlatteningMeshFilter.hxx"
143 #endif
144 
145 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ConformalFlatteningMeshFilter::InputMeshConstPointer
typename InputMeshType::ConstPointer InputMeshConstPointer
Definition: itkConformalFlatteningMeshFilter.h:63
itk::ConformalFlatteningMeshFilter::SparseMatrixCoordType
vnl_sparse_matrix< CoordRepType > SparseMatrixCoordType
Definition: itkConformalFlatteningMeshFilter.h:126
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::ConformalFlatteningMeshFilter::CoordRepType
double CoordRepType
Definition: itkConformalFlatteningMeshFilter.h:70
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ConformalFlatteningMeshFilter::CellsContainer
typename InputMeshType::CellsContainer CellsContainer
Definition: itkConformalFlatteningMeshFilter.h:83
itk::ConformalFlatteningMeshFilter::CellType
typename InputMeshType::CellType CellType
Definition: itkConformalFlatteningMeshFilter.h:88
itk::ConformalFlatteningMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkConformalFlatteningMeshFilter.h:66
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::ConformalFlatteningMeshFilter::PointIterator
typename PointsContainer::ConstIterator PointIterator
Definition: itkConformalFlatteningMeshFilter.h:86
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ConformalFlatteningMeshFilter::PointIdentifier
typename InputMeshType::PointIdentifier PointIdentifier
Definition: itkConformalFlatteningMeshFilter.h:84
itk::ConformalFlatteningMeshFilter::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkConformalFlatteningMeshFilter.h:65
itkMesh.h
itk::ConformalFlatteningMeshFilter::CellAutoPointer
typename CellType::CellAutoPointer CellAutoPointer
Definition: itkConformalFlatteningMeshFilter.h:90
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:87
itkMeshToMeshFilter.h
itk::ConformalFlatteningMeshFilter::VectorCoordType
vnl_vector< CoordRepType > VectorCoordType
Definition: itkConformalFlatteningMeshFilter.h:125
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:89
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::ConformalFlatteningMeshFilter::PointsContainer
typename InputMeshType::PointsContainer PointsContainer
Definition: itkConformalFlatteningMeshFilter.h:82
itkMath.h
itk::ConformalFlatteningMeshFilter
ConformalFlatteningMeshFilter applies a conformal mapping from 3D to 2D.
Definition: itkConformalFlatteningMeshFilter.h:47
itk::ConformalFlatteningMeshFilter::CellIdentifier
typename InputMeshType::CellIdentifier CellIdentifier
Definition: itkConformalFlatteningMeshFilter.h:85