ITK  5.4.0
Insight Toolkit
itkTriangleMeshCurvatureCalculator.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 
29 #ifndef itkTriangleMeshCurvatureCalculator_h
30 #define itkTriangleMeshCurvatureCalculator_h
31 
32 #include <iostream>
33 #include "itkMesh.h"
34 #include "itkTriangleCell.h"
35 #include "itkVectorContainer.h"
36 
37 namespace itk
38 {
45 {
46 public:
47  enum class Curvatures : uint8_t
48  {
53  };
54 };
55 
56 extern ITKMesh_EXPORT std::ostream &
57  operator<<(std::ostream & out, const TriangleMeshCurvatureCalculatorEnums::Curvatures value);
58 
67 template <typename TInputMesh>
68 class ITK_TEMPLATE_EXPORT TriangleMeshCurvatureCalculator : public Object
69 {
70 public:
71  ITK_DISALLOW_COPY_AND_MOVE(TriangleMeshCurvatureCalculator);
72 
75 
77  using Superclass = Object;
78 
82 
84  itkNewMacro(Self);
85 
87  itkOverrideGetNameOfClassMacro(TriangleMeshCurvatureCalculator);
88 
90  using InputMeshType = TInputMesh;
91  using PointIdentifier = typename InputMeshType::PointIdentifier;
94  using MeshPointIdConstIterator = typename InputMeshType::CellTraits::PointIdConstIterator;
95  using MeshPointsContainerConstPointer = typename InputMeshType::PointsContainerConstPointer;
96  using CellsContainerConstPointer = typename InputMeshType::CellsContainerConstPointer;
97  using CellsContainerConstIterator = typename InputMeshType::CellsContainer::ConstIterator;
98  using CellType = typename InputMeshType::CellType;
103 
105  itkSetMacro(CurvatureType, TriangleMeshCurvatureCalculatorEnums::Curvatures);
106  itkGetConstMacro(CurvatureType, TriangleMeshCurvatureCalculatorEnums::Curvatures);
110  itkSetObjectMacro(TriangleMesh, InputMeshType);
111 
113  itkGetConstObjectMacro(GaussCurvatureData, DoubleVectorContainer);
114 
116  void
118  {
120  }
121 
123  void
124  Compute();
125 
126 protected:
128  ~TriangleMeshCurvatureCalculator() override = default;
129 
130  void
131  PrintSelf(std::ostream & os, Indent indent) const override;
132 
134  void
135  ComputeGaussCurvature(const InputMeshType * input);
136 
137 private:
138  CurvaturesEnum m_CurvatureType = CurvaturesEnum::GaussCurvature;
139  DoubleVectorContainerPointer m_GaussCurvatureData{};
140  MeshConstPointer m_TriangleMesh{};
141 };
142 
143 } // namespace itk
144 #ifndef ITK_MANUAL_INSTANTIATION
145 # include "itkTriangleMeshCurvatureCalculator.hxx"
146 #endif
147 
148 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::TriangleMeshCurvatureCalculator::DoubleVectorContainerPointer
typename DoubleVectorContainer::Pointer DoubleVectorContainerPointer
Definition: itkTriangleMeshCurvatureCalculator.h:101
itk::TriangleMeshCurvatureCalculator::CellsContainerConstIterator
typename InputMeshType::CellsContainer::ConstIterator CellsContainerConstIterator
Definition: itkTriangleMeshCurvatureCalculator.h:97
itk::TriangleMeshCurvatureCalculatorEnums::Curvatures::MinCurvature
itk::operator<<
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216
itk::TriangleMeshCurvatureCalculatorEnums::Curvatures::MaxCurvature
itk::TriangleMeshCurvatureCalculator::SetCurvatureTypeToGaussian
void SetCurvatureTypeToGaussian()
Definition: itkTriangleMeshCurvatureCalculator.h:117
itk::TriangleMeshCurvatureCalculator::MeshConstPointer
typename InputMeshType::ConstPointer MeshConstPointer
Definition: itkTriangleMeshCurvatureCalculator.h:92
itk::TriangleMeshCurvatureCalculatorEnums::Curvatures::MeanCurvature
itk::TriangleMeshCurvatureCalculator::CellType
typename InputMeshType::CellType CellType
Definition: itkTriangleMeshCurvatureCalculator.h:98
itk::TriangleMeshCurvatureCalculator::CellsContainerConstPointer
typename InputMeshType::CellsContainerConstPointer CellsContainerConstPointer
Definition: itkTriangleMeshCurvatureCalculator.h:96
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::TriangleMeshCurvatureCalculator::MeshPointIdConstIterator
typename InputMeshType::CellTraits::PointIdConstIterator MeshPointIdConstIterator
Definition: itkTriangleMeshCurvatureCalculator.h:94
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TriangleMeshCurvatureCalculatorEnums
Definition: itkTriangleMeshCurvatureCalculator.h:44
itk::TriangleMeshCurvatureCalculator::MeshPointType
typename InputMeshType::PointType MeshPointType
Definition: itkTriangleMeshCurvatureCalculator.h:93
itk::TriangleMeshCurvatureCalculator::DoubleVectorContainer
typename itk::VectorContainer< PointIdentifier, double > DoubleVectorContainer
Definition: itkTriangleMeshCurvatureCalculator.h:100
itk::TriangleMeshCurvatureCalculator::PointIdentifier
typename InputMeshType::PointIdentifier PointIdentifier
Definition: itkTriangleMeshCurvatureCalculator.h:91
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMesh.h
itk::TriangleMeshCurvatureCalculatorEnums::Curvatures::GaussCurvature
itk::TriangleCell
Definition: itkTriangleCell.h:46
itk::TriangleMeshCurvatureCalculatorEnums::Curvatures
Curvatures
Definition: itkTriangleMeshCurvatureCalculator.h:47
itk::TriangleMeshCurvatureCalculator::InputMeshType
TInputMesh InputMeshType
Definition: itkTriangleMeshCurvatureCalculator.h:90
itkVectorContainer.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TriangleMeshCurvatureCalculator
Calculator to compute curvature of a triangle mesh. Set the input triangle mesh and the required curv...
Definition: itkTriangleMeshCurvatureCalculator.h:68
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itkTriangleCell.h
itk::TriangleMeshCurvatureCalculator::MeshPointsContainerConstPointer
typename InputMeshType::PointsContainerConstPointer MeshPointsContainerConstPointer
Definition: itkTriangleMeshCurvatureCalculator.h:95
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48