ITK  6.0.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 CoordinateType = typename TInputMesh::CoordinateType;
70  using CoordinateType = double;
71 #ifndef ITK_FUTURE_LEGACY_REMOVE
72  using CoordRepType ITK_FUTURE_DEPRECATED(
73  "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
74 #endif
75 
77  itkNewMacro(Self);
78 
80  itkOverrideGetNameOfClassMacro(ConformalFlatteningMeshFilter);
81 
83  static constexpr unsigned int InputPointDimension = TInputMesh::PointDimension;
84  static constexpr unsigned int OutputPointDimension = TOutputMesh::PointDimension;
85 
86  using PointsContainer = typename InputMeshType::PointsContainer;
87  using CellsContainer = typename InputMeshType::CellsContainer;
88  using PointIdentifier = typename InputMeshType::PointIdentifier;
89  using CellIdentifier = typename InputMeshType::CellIdentifier;
90  using PointIterator = typename PointsContainer::ConstIterator;
91  using CellIterator = typename CellsContainer::ConstIterator;
92  using CellType = typename InputMeshType::CellType;
93  using PointIdIterator = typename CellType::PointIdIterator;
94  using CellAutoPointer = typename CellType::CellAutoPointer;
95 
101  void
102  SetPolarCellIdentifier(CellIdentifier cellId);
103 
106  void
107  SetScale(double);
108 
110  void
111  MapToSphere();
112 
115  void
116  MapToPlane();
117 
118 protected:
120  ~ConformalFlatteningMeshFilter() override = default;
121  void
122  PrintSelf(std::ostream & os, Indent indent) const override;
123 
125  void
126  GenerateData() override;
127 
128 private:
129  using VectorCoordType = vnl_vector<CoordinateType>;
130  using SparseMatrixCoordType = vnl_sparse_matrix<CoordinateType>;
131 
134  unsigned int m_PolarCellIdentifier{};
135 
137  bool m_MapToSphere{};
138 
141  double m_MapScale{};
142 };
143 } // end namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 # include "itkConformalFlatteningMeshFilter.hxx"
147 #endif
148 
149 #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::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
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:87
itk::ConformalFlatteningMeshFilter::CellType
typename InputMeshType::CellType CellType
Definition: itkConformalFlatteningMeshFilter.h:92
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:90
itk::ConformalFlatteningMeshFilter::SparseMatrixCoordType
vnl_sparse_matrix< CoordinateType > SparseMatrixCoordType
Definition: itkConformalFlatteningMeshFilter.h:130
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ConformalFlatteningMeshFilter::PointIdentifier
typename InputMeshType::PointIdentifier PointIdentifier
Definition: itkConformalFlatteningMeshFilter.h:88
itk::ConformalFlatteningMeshFilter::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkConformalFlatteningMeshFilter.h:65
itkMesh.h
itk::ConformalFlatteningMeshFilter::CellAutoPointer
typename CellType::CellAutoPointer CellAutoPointer
Definition: itkConformalFlatteningMeshFilter.h:94
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:91
itkMeshToMeshFilter.h
itk::ConformalFlatteningMeshFilter::CoordinateType
double CoordinateType
Definition: itkConformalFlatteningMeshFilter.h:70
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ConformalFlatteningMeshFilter::PointIdIterator
typename CellType::PointIdIterator PointIdIterator
Definition: itkConformalFlatteningMeshFilter.h:93
itk::ConformalFlatteningMeshFilter::VectorCoordType
vnl_vector< CoordinateType > VectorCoordType
Definition: itkConformalFlatteningMeshFilter.h:129
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::ConformalFlatteningMeshFilter::PointsContainer
typename InputMeshType::PointsContainer PointsContainer
Definition: itkConformalFlatteningMeshFilter.h:86
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:89