ITK  5.2.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  * 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 itkDiscreteCurvatureQuadEdgeMeshFilter_h
19 #define itkDiscreteCurvatureQuadEdgeMeshFilter_h
20 
22 #include "itkConceptChecking.h"
23 #include "itkTriangleHelper.h"
24 
25 namespace itk
26 {
34 template <typename TInputMesh, typename TOutputMesh = TInputMesh>
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_MOVE(DiscreteCurvatureQuadEdgeMeshFilter);
39 
44 
45  using InputMeshType = TInputMesh;
46  using InputMeshPointer = typename InputMeshType::Pointer;
47 
48  using OutputMeshType = TOutputMesh;
49  using OutputMeshPointer = typename OutputMeshType::Pointer;
50  using OutputPointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
51  using OutputPointsContainerIterator = typename OutputMeshType::PointsContainerIterator;
53  using OutputCoordType = typename OutputPointType::CoordRepType;
54  using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
55  using OutputCellIdentifier = typename OutputMeshType::CellIdentifier;
56  using OutputQEType = typename OutputMeshType::QEType;
57  using OutputMeshTraits = typename OutputMeshType::MeshTraits;
58  using OutputCurvatureType = typename OutputMeshTraits::PixelType;
59 
61 
64 
65 #ifdef ITK_USE_CONCEPT_CHECKING
66  // Begin concept checking
68  // End concept checking
69 #endif
70 
71 protected:
73  : m_OutputMesh(nullptr)
74  {}
75  ~DiscreteCurvatureQuadEdgeMeshFilter() override = default;
76 
77  virtual OutputCurvatureType
78  EstimateCurvature(const OutputPointType & iP) = 0;
79 
82  {
83 
85 
86  id[0] = iQE1->GetOrigin();
87  id[1] = iQE1->GetDestination();
88  id[2] = iQE2->GetDestination();
89 
90  OutputPointType p[3];
91 
92  for (int i = 0; i < 3; i++)
93  {
94  p[i] = this->m_OutputMesh->GetPoint(id[i]);
95  }
96 
97  return static_cast<OutputCurvatureType>(TriangleType::ComputeMixedArea(p[0], p[1], p[2]));
98  }
99 
100  void
101  GenerateData() override
102  {
104 
105  OutputMeshPointer output = this->GetOutput();
106 
107  OutputPointsContainerPointer points = output->GetPoints();
108  OutputPointsContainerIterator p_it = points->Begin();
109 
110  OutputCurvatureType curvature;
111 
112  this->m_OutputMesh = this->GetOutput();
113  while (p_it != points->End())
114  {
115  curvature = this->EstimateCurvature(p_it->Value());
116  output->SetPointData(p_it->Index(), curvature);
117  ++p_it;
118  }
119  }
120 
121 private:
124 };
125 } // end namespace itk
126 
127 #endif
itk::DiscreteCurvatureQuadEdgeMeshFilter::ComputeMixedArea
OutputCurvatureType ComputeMixedArea(OutputQEType *iQE1, OutputQEType *iQE2)
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:81
itk::DiscreteCurvatureQuadEdgeMeshFilter::EstimateCurvature
virtual OutputCurvatureType EstimateCurvature(const OutputPointType &iP)=0
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::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkConceptChecking.h
itk::SmartPointer< Self >
itk::TriangleHelper
A convenience class for computation of various triangle elements in 2D or 3D.
Definition: itkTriangleHelper.h:31
itkQuadEdgeMeshToQuadEdgeMeshFilter.h
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::DiscreteCurvatureQuadEdgeMeshFilter::GenerateData
void GenerateData() override
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:101
itk::DiscreteCurvatureQuadEdgeMeshFilter::m_OutputMesh
OutputMeshType * m_OutputMesh
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:123
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCurvatureType
typename OutputMeshTraits::PixelType OutputCurvatureType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:58
itk::QuadEdgeMeshToQuadEdgeMeshFilter
Duplicates the content of a Mesh.
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:37
itk::TriangleHelper::ComputeMixedArea
static CoordRepType ComputeMixedArea(const PointType &iP1, const PointType &iP2, const PointType &iP3)
itk::Concept::IsFloatingPoint
Definition: itkConceptChecking.h:946
itkTriangleHelper.h
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
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::OutputQEType
typename OutputMeshType::QEType OutputQEType
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:56
itk::DiscreteCurvatureQuadEdgeMeshFilter::~DiscreteCurvatureQuadEdgeMeshFilter
~DiscreteCurvatureQuadEdgeMeshFilter() override=default
itk::DiscreteCurvatureQuadEdgeMeshFilter::DiscreteCurvatureQuadEdgeMeshFilter
DiscreteCurvatureQuadEdgeMeshFilter()
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:72
itk::DiscreteCurvatureQuadEdgeMeshFilter::OutputCellIdentifier
typename OutputMeshType::CellIdentifier OutputCellIdentifier
Definition: itkDiscreteCurvatureQuadEdgeMeshFilter.h:55
itk::QuadEdgeMeshToQuadEdgeMeshFilter::CopyInputMeshToOutputMesh
virtual void CopyInputMeshToOutputMesh()
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:81
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:80
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointsContainerIterator
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:85