ITK  6.0.0
Insight Toolkit
itkDiscreteCurvatureQuadEdgeMeshFilter.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 itkDiscreteCurvatureQuadEdgeMeshFilter_h
19#define itkDiscreteCurvatureQuadEdgeMeshFilter_h
20
22#include "itkConceptChecking.h"
23#include "itkTriangleHelper.h"
24
25namespace itk
26{
34template <typename TInputMesh, typename TOutputMesh = TInputMesh>
35class ITK_TEMPLATE_EXPORT DiscreteCurvatureQuadEdgeMeshFilter
36 : public QuadEdgeMeshToQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
37{
38public:
39 ITK_DISALLOW_COPY_AND_MOVE(DiscreteCurvatureQuadEdgeMeshFilter);
40
45
46 using InputMeshType = TInputMesh;
48
49 using OutputMeshType = TOutputMesh;
51 using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
52 using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
54 using OutputCoordType = typename OutputPointType::CoordRepType;
55 using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
56 using OutputCellIdentifier = typename OutputMeshType::CellIdentifier;
57 using OutputQEType = typename OutputMeshType::QEType;
58 using OutputMeshTraits = typename OutputMeshType::MeshTraits;
59 using OutputCurvatureType = typename OutputMeshTraits::PixelType;
60
62
64 itkOverrideGetNameOfClassMacro(DiscreteCurvatureQuadEdgeMeshFilter);
65
66#ifdef ITK_USE_CONCEPT_CHECKING
67 // Begin concept checking
69 // End concept checking
70#endif
71
72protected:
74 : m_OutputMesh(nullptr)
75 {}
77
80
83 {
84
86
87 id[0] = iQE1->GetOrigin();
88 id[1] = iQE1->GetDestination();
89 id[2] = iQE2->GetDestination();
90
91 OutputPointType p[3];
92
93 for (int i = 0; i < 3; ++i)
94 {
95 p[i] = this->m_OutputMesh->GetPoint(id[i]);
96 }
97
98 return static_cast<OutputCurvatureType>(TriangleType::ComputeMixedArea(p[0], p[1], p[2]));
99 }
100
101 void
102 GenerateData() override
103 {
104 this->CopyInputMeshToOutputMesh();
105
106 OutputMeshPointer output = this->GetOutput();
107
108 OutputPointsContainerPointer points = output->GetPoints();
109 OutputPointsContainerIterator p_it = points->Begin();
110
111 OutputCurvatureType curvature;
112
113 this->m_OutputMesh = this->GetOutput();
114 while (p_it != points->End())
115 {
116 curvature = this->EstimateCurvature(p_it->Value());
117 output->SetPointData(p_it->Index(), curvature);
118 ++p_it;
119 }
120 }
121
122private:
124 OutputMeshType * m_OutputMesh{};
125};
126} // end namespace itk
127
128#endif
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
typename OutputMeshType::PointIdentifier OutputPointIdentifier
OutputCurvatureType ComputeMixedArea(OutputQEType *iQE1, OutputQEType *iQE2)
virtual OutputCurvatureType EstimateCurvature(const OutputPointType &iP)=0
~DiscreteCurvatureQuadEdgeMeshFilter() override=default
typename OutputMeshType::CellIdentifier OutputCellIdentifier
Light weight base class for most itk classes.
A convenience class for computation of various triangle elements in 2D or 3D.
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....