18 #ifndef itkSimplexMeshAdaptTopologyFilter_h
19 #define itkSimplexMeshAdaptTopologyFilter_h
28 #include "vxl_version.h"
29 #include "vnl/vnl_cross.h"
44 template <
typename TInputMesh,
typename TOutputMesh>
130 typename InputPolygonType::PointIdIterator it = poly->
PointIdsBegin();
132 double meanCurvature = 0;
134 double val = mesh->GetMeanCurvature(*it++);
138 val = mesh->GetMeanCurvature(*it++);
150 area += ComputeArea(refPoint, id1, id2);
152 val = mesh->GetMeanCurvature(*it);
158 meanCurvature /= static_cast<double>(cnt);
160 totalCurvature += meanCurvature;
162 areaMap->InsertElement(cellId, area);
163 curvatureMap->InsertElement(cellId, meanCurvature);
165 if (area > maxCellSize)
169 if (area < minCellSize)
173 if (meanCurvature > maxCurvature)
175 maxCurvature = meanCurvature;
177 if (meanCurvature < minCurvature)
179 minCurvature = meanCurvature;
194 mesh->GetPoint(p1, &v1);
195 mesh->GetPoint(p2, &v2);
196 mesh->GetPoint(p3, &v3);
197 return itk::Math::abs(vnl_cross_3d((v2 - v1).GetVnlVector(), (v3 - v1).GetVnlVector()).two_norm() / 2.0);
221 return totalCurvature / (curvatureMap->Size());
250 using SimplexVisitorInterfaceType =
257 itkSetMacro(Threshold,
double);
258 itkGetConstMacro(Threshold,
double);
260 itkSetMacro(SelectionMethod,
int);
261 itkGetConstMacro(SelectionMethod,
int);
263 itkGetConstMacro(ModifiedCount,
int);
270 PrintSelf(std::ostream & os,
Indent indent)
const override;
273 GenerateData()
override;
287 ComputeCellParameters();
291 CopyInputMeshToOutputMeshGeometryData();
316 double m_Threshold{ 0.5 };
321 int m_SelectionMethod{ 0 };
327 int m_ModifiedCount{ 0 };
339 #ifndef ITK_MANUAL_INSTANTIATION
340 # include "itkSimplexMeshAdaptTopologyFilter.hxx"
343 #endif // itkSimplexMeshAdaptTopologyFilter_h