18#ifndef itkSimplexMeshAdaptTopologyFilter_h
19#define itkSimplexMeshAdaptTopologyFilter_h
28#include "vxl_version.h"
29#include "vnl/vnl_cross.h"
44template <
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;
192 mesh->GetPoint(p1, &v1);
193 mesh->GetPoint(p2, &v2);
194 mesh->GetPoint(p3, &v3);
195 return itk::Math::abs(vnl_cross_3d((v2 - v1).GetVnlVector(), (v3 - v1).GetVnlVector()).two_norm() / 2.0);
219 return totalCurvature / (curvatureMap->Size());
255 itkSetMacro(Threshold,
double);
256 itkGetConstMacro(Threshold,
double);
258 itkSetMacro(SelectionMethod,
int);
259 itkGetConstMacro(SelectionMethod,
int);
261 itkGetConstMacro(ModifiedCount,
int);
314 double m_Threshold{ 0.5 };
319 int m_SelectionMethod{ 0 };
325 int m_ModifiedCount{ 0 };
337#ifndef ITK_MANUAL_INSTANTIATION
338# include "itkSimplexMeshAdaptTopologyFilter.hxx"
A template class used to implement a visitor object.
A templated class holding a n-Dimensional covariant vector.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
A wrapper of the STL "map" container.
typename OutputMeshType::Pointer OutputMeshPointer
TOutputMesh OutputMeshType
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
typename InputMeshType::Pointer InputMeshPointer
static constexpr T max(const T &)
Represents a polygon in a Mesh.
PointIdIterator PointIdsEnd() override
PointIdIterator PointIdsBegin() override
void Visit(CellIdentifier cellId, InputPolygonType *poly)
visits all polygon cells and computes the area, NOTE: works for convex polygons only!...
DoubleValueMapType::Pointer curvatureMap
double GetTotalMeanCurvature()
DoubleValueMapType::Pointer GetCurvatureMap()
DoubleValueMapType::Pointer GetAreaMap()
double GetMinimumCurvature()
double ComputeArea(PointIdentifier p1, PointIdentifier p2, PointIdentifier p3)
DoubleValueMapType::Pointer areaMap
double GetMaximumCurvature()
double GetMinimumCellSize()
double GetMaximumCellSize()
double GetTotalMeshArea()
This filter changes the topology of a 2-simplex mesh.
void ComputeCellParameters()
typename InputCellType::PointIdIterator InputCellPointIdIterator
typename InputCellType::MultiVisitor CellMultiVisitorType
typename InputMeshType::PointType InputPointType
void ModifyNeighborCells(CellIdentifier id1, CellIdentifier id2, PointIdentifier insertPointId)
typename InputCellType::CellAutoPointer InputCellAutoPointer
void CopyInputMeshToOutputMeshGeometryData()
typename InputMeshType::VectorType InputVectorType
typename InputMeshType::CellIdentifier CellIdentifier
typename InputMeshType::MeshTraits::CellTraits InputCellTraitsType
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateData() override
typename DoubleValueMapType::Iterator DoubleContainerIterator
typename InputMeshType::PointIdentifier PointIdentifier
typename CellMultiVisitorType::Pointer CellMultiVisitorPointer
typename SimplexVisitorInterfaceType::Pointer SimplexVisitorInterfacePointer
typename InputMeshType::CellAutoPointer CellAutoPointer
~SimplexMeshAdaptTopologyFilter() override=default
typename InputMeshType::PixelType InputPixelType
typename InputMeshType::CellType InputCellType
typename itk::MapContainer< CellIdentifier, double > DoubleValueMapType
typename OutputMeshType::CellType OutputCellType
SimplexMeshAdaptTopologyFilter()
typename InputPolygonType::PointIdIterator InputPolygonPointIdIterator
InputPointType ComputeCellCenter(InputCellAutoPointer &simplexCell)
SmartPointer< Self > Pointer
ImageBaseType::PointType PointType
ImageBaseType::SpacingType VectorType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....