ITK  5.4.0
Insight Toolkit
itkDiscreteMeanCurvatureQuadEdgeMeshFilter.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 itkDiscreteMeanCurvatureQuadEdgeMeshFilter_h
19#define itkDiscreteMeanCurvatureQuadEdgeMeshFilter_h
20
23
24namespace itk
25{
35template <typename TInputMesh, typename TOutputMesh = TInputMesh>
37 : public DiscreteCurvatureQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(DiscreteMeanCurvatureQuadEdgeMeshFilter);
41
46
47 using typename Superclass::InputMeshType;
48 using typename Superclass::InputMeshPointer;
49
50 using typename Superclass::OutputMeshType;
51 using typename Superclass::OutputMeshPointer;
52 using typename Superclass::OutputPointsContainerPointer;
53 using typename Superclass::OutputPointsContainerIterator;
54 using typename Superclass::OutputPointType;
55 using typename Superclass::OutputVectorType;
56 using typename Superclass::OutputCoordType;
57 using typename Superclass::OutputPointIdentifier;
58 using typename Superclass::OutputCellIdentifier;
59 using typename Superclass::OutputQEType;
60 using typename Superclass::OutputMeshTraits;
61 using typename Superclass::OutputCurvatureType;
62
63 using typename Superclass::TriangleType;
64
66 itkOverrideGetNameOfClassMacro(DiscreteMeanCurvatureQuadEdgeMeshFilter);
67
69 itkNewMacro(Self);
70
72
73#ifdef ITK_USE_CONCEPT_CHECKING
74 // Begin concept checking
76 // End concept checking
77#endif
78
79protected:
82
85 {
86 OutputMeshPointer output = this->GetOutput();
87
88 OutputQEType * qe = iP.GetEdge();
89
91
92 OutputVectorType Laplace;
93
94 Laplace.Fill(0.);
95
96 OutputCurvatureType area(0.);
97 OutputVectorType normal;
98 normal.Fill(0.);
99
100 if (qe != nullptr)
101 {
102 if (qe != qe->GetOnext())
103 {
104 CoefficientType coefficent;
105
106 OutputQEType * qe_it = qe;
107 OutputQEType * qe_it2;
108
109 OutputCurvatureType temp_area;
110 OutputCoordType temp_coeff;
111
112 OutputPointType q0, q1;
113 OutputVectorType face_normal;
114
115 do
116 {
117 qe_it2 = qe_it->GetOnext();
118 q0 = output->GetPoint(qe_it->GetDestination());
119 q1 = output->GetPoint(qe_it2->GetDestination());
120
121 temp_coeff = coefficent(output, qe_it);
122 Laplace += temp_coeff * (iP - q0);
123
124 temp_area = this->ComputeMixedArea(qe_it, qe_it2);
125 area += temp_area;
126
127 face_normal = TriangleType::ComputeNormal(q0, iP, q1);
128 normal += face_normal;
129
130 qe_it = qe_it2;
131 } while (qe_it != qe);
132
133 if (area < 1e-6)
134 {
135 oH = 0.;
136 }
137 else
138 {
139 if (normal.GetSquaredNorm() > 0.)
140 {
141 normal.Normalize();
142 Laplace *= 0.25 / area;
143 oH = Laplace * normal;
144 }
145 else
146 {
147 oH = 0.;
148 }
149 }
150 }
151 }
152 return oH;
153 }
154};
155} // namespace itk
156#endif
Compute a matrix filed by Conformal Coefficients of the edge wherever two vertices are connected by a...
see the following paper title: Discrete Differential-Geometry Operators for Triangulated 2-Manifolds ...
~DiscreteMeanCurvatureQuadEdgeMeshFilter() override=default
OutputCurvatureType EstimateCurvature(const OutputPointType &iP) override
Light weight base class for most itk classes.
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
#define itkConceptMacro(name, concept)
static constexpr double e
Definition: itkMath.h:56
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....