ITK  5.2.0
Insight Toolkit
itkDiscreteGaussianCurvatureQuadEdgeMeshFilter.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 itkDiscreteGaussianCurvatureQuadEdgeMeshFilter_h
19 #define itkDiscreteGaussianCurvatureQuadEdgeMeshFilter_h
20 
22 #include "itkMath.h"
23 
24 
25 namespace itk
26 {
37 template <typename TInputMesh, typename TOutputMesh = TInputMesh>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(DiscreteGaussianCurvatureQuadEdgeMeshFilter);
42 
47 
50 
64 
67 
69  itkNewMacro(Self);
70 
71 #ifdef ITK_USE_CONCEPT_CHECKING
72  // Begin concept checking
74  // End concept checking
75 #endif
76 
77 protected:
80 
82  EstimateCurvature(const OutputPointType & iP) override
83  {
84  OutputMeshPointer output = this->GetOutput();
85 
86  OutputQEType * qe = iP.GetEdge();
87 
88  if (qe != nullptr)
89  {
90  OutputQEType * qe_it = qe;
91  OutputQEType * qe_it2;
92 
93  OutputPointType q0, q1;
94 
95  OutputCurvatureType sum_theta = 0.;
96  OutputCurvatureType area = 0.;
97 
98  do
99  {
100  // cell_id = qe_it->GetLeft();
101  qe_it2 = qe_it->GetOnext();
102  q0 = output->GetPoint(qe_it->GetDestination());
103  q1 = output->GetPoint(qe_it2->GetDestination());
104 
105  // Compute Angle;
106  sum_theta += static_cast<OutputCurvatureType>(TriangleType::ComputeAngle(q0, iP, q1));
107  area += this->ComputeMixedArea(qe_it, qe_it2);
108  qe_it = qe_it2;
109  } while (qe_it != qe);
110 
111  return (2.0 * itk::Math::pi - sum_theta) / area;
112  }
113 
114  return 0.;
115  }
116 };
117 } // namespace itk
118 
119 #endif
itk::DiscreteCurvatureQuadEdgeMeshFilter::ComputeMixedArea
OutputCurvatureType ComputeMixedArea(OutputQEType *iQE1, OutputQEType *iQE2)
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:81
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:49
itk::DiscreteCurvatureQuadEdgeMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:45
itk::MeshSource::GetOutput
OutputMeshType * GetOutput()
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:48
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointsContainerPointer
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:86
itk::MeshToMeshFilter::InputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
Definition: itkMeshToMeshFilter.h:66
itk::DiscreteCurvatureQuadEdgeMeshFilter::InputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:46
itk::DiscreteGaussianCurvatureQuadEdgeMeshFilter::~DiscreteGaussianCurvatureQuadEdgeMeshFilter
~DiscreteGaussianCurvatureQuadEdgeMeshFilter() override=default
itkDiscreteCurvatureQuadEdgeMeshFilter.h
itk::SmartPointer< Self >
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:54
itk::TriangleHelper
A convenience class for computation of various triangle elements in 2D or 3D.
Definition: itkTriangleHelper.h:31
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::DiscreteCurvatureQuadEdgeMeshFilter::TriangleType
TriangleHelper< OutputPointType > TriangleType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:60
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputPointsContainerPointer
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:50
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCurvatureType
typename OutputMeshTraits::PixelType OutputCurvatureType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:58
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputVectorType
typename OutputMeshType::VectorType OutputVectorType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:83
itk::Concept::IsFloatingPoint
Definition: itkConceptChecking.h:946
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputMeshTraits
typename OutputMeshType::MeshTraits OutputMeshTraits
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:57
itk::DiscreteGaussianCurvatureQuadEdgeMeshFilter
see the following paper title: Discrete Differential-Geometry Operators for Triangulated 2-Manifolds ...
Definition: itkDiscreteGaussianCurvatureQuadEdgeMeshFilter.h:38
itk::DiscreteGaussianCurvatureQuadEdgeMeshFilter::EstimateCurvature
OutputCurvatureType EstimateCurvature(const OutputPointType &iP) override
Definition: itkDiscreteGaussianCurvatureQuadEdgeMeshFilter.h:82
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:52
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCoordType
typename OutputPointType::CoordRepType OutputCoordType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:53
itk::DiscreteCurvatureQuadEdgeMeshFilter
FIXME.
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:35
itk::DiscreteGaussianCurvatureQuadEdgeMeshFilter::DiscreteGaussianCurvatureQuadEdgeMeshFilter
DiscreteGaussianCurvatureQuadEdgeMeshFilter()=default
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputPointsContainerIterator
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:51
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputQEType
typename OutputMeshType::QEType OutputQEType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:56
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCellIdentifier
typename OutputMeshType::CellIdentifier OutputCellIdentifier
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:55
itk::Math::pi
static constexpr double pi
Definition: itkMath.h:64
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:81
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:80
itkMath.h
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointsContainerIterator
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:85