ITK  5.2.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  * 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 itkDiscreteMeanCurvatureQuadEdgeMeshFilter_h
19 #define itkDiscreteMeanCurvatureQuadEdgeMeshFilter_h
20 
23 
24 namespace itk
25 {
35 template <typename TInputMesh, typename TOutputMesh = TInputMesh>
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_MOVE(DiscreteMeanCurvatureQuadEdgeMeshFilter);
40 
45 
48 
61 
63 
66 
68  itkNewMacro(Self);
69 
71 
72 #ifdef ITK_USE_CONCEPT_CHECKING
73  // Begin concept checking
75  // End concept checking
76 #endif
77 
78 protected:
80  ~DiscreteMeanCurvatureQuadEdgeMeshFilter() override = default;
81 
83  EstimateCurvature(const OutputPointType & iP) override
84  {
85  OutputMeshPointer output = this->GetOutput();
86 
87  OutputQEType * qe = iP.GetEdge();
88 
89  OutputCurvatureType oH(0.);
90 
91  OutputVectorType Laplace;
92 
93  Laplace.Fill(0.);
94 
95  OutputCurvatureType area(0.);
96  OutputVectorType normal;
97  normal.Fill(0.);
98 
99  if (qe != nullptr)
100  {
101  if (qe != qe->GetOnext())
102  {
103  CoefficientType coefficent;
104 
105  OutputQEType * qe_it = qe;
106  OutputQEType * qe_it2;
107 
108  OutputCurvatureType temp_area;
109  OutputCoordType temp_coeff;
110 
111  OutputPointType q0, q1;
112  OutputVectorType face_normal;
113 
114  do
115  {
116  qe_it2 = qe_it->GetOnext();
117  q0 = output->GetPoint(qe_it->GetDestination());
118  q1 = output->GetPoint(qe_it2->GetDestination());
119 
120  temp_coeff = coefficent(output, qe_it);
121  Laplace += temp_coeff * (iP - q0);
122 
123  temp_area = this->ComputeMixedArea(qe_it, qe_it2);
124  area += temp_area;
125 
126  face_normal = TriangleType::ComputeNormal(q0, iP, q1);
127  normal += face_normal;
128 
129  qe_it = qe_it2;
130  } while (qe_it != qe);
131 
132  if (area < 1e-6)
133  {
134  oH = 0.;
135  }
136  else
137  {
138  if (normal.GetSquaredNorm() > 0.)
139  {
140  normal.Normalize();
141  Laplace *= 0.25 / area;
142  oH = Laplace * normal;
143  }
144  else
145  {
146  oH = 0.;
147  }
148  }
149  }
150  }
151  return oH;
152  }
153 };
154 } // namespace itk
155 #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::DiscreteMeanCurvatureQuadEdgeMeshFilter
see the following paper title: Discrete Differential-Geometry Operators for Triangulated 2-Manifolds ...
Definition: itkDiscreteMeanCurvatureQuadEdgeMeshFilter.h:36
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
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::DiscreteMeanCurvatureQuadEdgeMeshFilter::EstimateCurvature
OutputCurvatureType EstimateCurvature(const OutputPointType &iP) override
Definition: itkDiscreteMeanCurvatureQuadEdgeMeshFilter.h:83
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::ConformalMatrixCoefficients
Compute a matrix filed by Conformal Coefficients of the edge wherever two vertices are connected by a...
Definition: itkQuadEdgeMeshParamMatrixCoefficients.h:127
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCurvatureType
typename OutputMeshTraits::PixelType OutputCurvatureType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:58
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputVectorType
typename OutputMeshType::VectorType OutputVectorType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:83
itkQuadEdgeMeshParamMatrixCoefficients.h
itk::Concept::IsFloatingPoint
Definition: itkConceptChecking.h:946
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputMeshTraits
typename OutputMeshType::MeshTraits OutputMeshTraits
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:57
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::DiscreteMeanCurvatureQuadEdgeMeshFilter::DiscreteMeanCurvatureQuadEdgeMeshFilter
DiscreteMeanCurvatureQuadEdgeMeshFilter()=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::Math::e
static constexpr double e
Definition: itkMath.h:54
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCellIdentifier
typename OutputMeshType::CellIdentifier OutputCellIdentifier
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:55
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:81
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:80
itk::DiscreteMeanCurvatureQuadEdgeMeshFilter::~DiscreteMeanCurvatureQuadEdgeMeshFilter
~DiscreteMeanCurvatureQuadEdgeMeshFilter() override=default
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointsContainerIterator
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:85