ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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;
47 using InputMeshPointer = typename InputMeshType::Pointer;
48
49 using OutputMeshType = TOutputMesh;
50 using OutputMeshPointer = typename OutputMeshType::Pointer;
51 using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
52 using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
53 using OutputPointType = typename OutputMeshType::PointType;
54 using OutputCoordType = typename OutputPointType::CoordinateType;
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
67
68protected:
73
76
79 {
80
82
83 id[0] = iQE1->GetOrigin();
84 id[1] = iQE1->GetDestination();
85 id[2] = iQE2->GetDestination();
86
87 OutputPointType p[3];
88
89 for (int i = 0; i < 3; ++i)
90 {
91 p[i] = this->m_OutputMesh->GetPoint(id[i]);
92 }
93
94 return static_cast<OutputCurvatureType>(TriangleType::ComputeMixedArea(p[0], p[1], p[2]));
95 }
96
97 void
98 GenerateData() override
99 {
101
102 const OutputMeshPointer output = this->GetOutput();
103
104 const OutputPointsContainerPointer points = output->GetPoints();
105 OutputPointsContainerIterator p_it = points->Begin();
106
107 OutputCurvatureType curvature;
108
109 this->m_OutputMesh = this->GetOutput();
110 while (p_it != points->End())
111 {
112 curvature = this->EstimateCurvature(p_it->Value());
113 output->SetPointData(p_it->Index(), curvature);
114 ++p_it;
115 }
116 }
117
118private:
121};
122} // end namespace itk
123
124#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 OutputPointType::CoordinateType OutputCoordType
QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh > Superclass
typename OutputMeshType::CellIdentifier OutputCellIdentifier
OutputMeshType * GetOutput()
Implements transparent reference counting.
A convenience class for computation of various triangle elements in 2D or 3D.
static CoordinateType ComputeMixedArea(const PointType &iP1, const PointType &iP2, const PointType &iP3)
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....