18 #ifndef itkSimplexMeshAdaptTopologyFilter_h
19 #define itkSimplexMeshAdaptTopologyFilter_h
28 #include "vxl_version.h"
29 #if VXL_VERSION_DATE_FULL > 20040406
30 #include "vnl/vnl_cross.h"
31 #define itk_cross_3d vnl_cross_3d
33 #define itk_cross_3d cross_3d
49 template<
typename TInputMesh,
typename TOutputMesh >
117 areaMap = DoubleValueMapType::New();
118 curvatureMap = DoubleValueMapType::New();
132 typename InputPolygonType::PointIdIterator it = poly->
PointIdsBegin();
134 double meanCurvature = 0;
136 double val = mesh->GetMeanCurvature(*it++);
140 val = mesh->GetMeanCurvature(*it++);
152 area += ComputeArea(refPoint, id1, id2);
154 val = mesh->GetMeanCurvature(*it);
160 meanCurvature /= (double)cnt;
162 totalCurvature += meanCurvature;
164 areaMap->InsertElement(cellId, area);
165 curvatureMap->InsertElement(cellId, meanCurvature);
167 if ( area > maxCellSize ) { maxCellSize = area; }
168 if ( area < minCellSize ) { minCellSize = area; }
169 if ( meanCurvature > maxCurvature ) { maxCurvature = meanCurvature; }
170 if ( meanCurvature < minCurvature ) { minCurvature = meanCurvature; }
181 mesh->GetPoint(p1, &v1);
182 mesh->GetPoint(p2, &v2);
183 mesh->GetPoint(p3, &v3);
184 return std::abs (
itk_cross_3d( ( v2 - v1 ).GetVnlVector(), ( v3 - v1 ).GetVnlVector() ).two_norm() / 2.0);
204 return totalCurvature / ( curvatureMap->Size() );
239 itkSetMacro(Threshold,
double);
240 itkGetConstMacro(Threshold,
double);
242 itkSetMacro(SelectionMethod,
int);
243 itkGetConstMacro(SelectionMethod,
int);
245 itkGetConstMacro(ModifiedCount,
int);
255 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
257 virtual void GenerateData() ITK_OVERRIDE;
269 void ComputeCellParameters();
272 void CopyInputMeshToOutputMeshGeometryData();
279 void ModifyNeighborCells(CellIdentifier id1, CellIdentifier id2, PointIdentifier insertPointId);
284 InputPointType ComputeCellCenter(InputCellAutoPointer & simplexCell);
300 int m_SelectionMethod;
318 #ifndef ITK_MANUAL_INSTANTIATION
319 #include "itkSimplexMeshAdaptTopologyFilter.hxx"
322 #endif // itkSimplexMeshAdaptTopologyFilter_h
double GetMinimumCurvature()
Light weight base class for most itk classes.
CovariantVector< typename InputVectorType::ValueType, 3 > CovariantVectorType
A template class used to implement a visitor object.
DoubleValueMapType::Pointer curvatureMap
InputCellType::PointIdIterator InputCellPointIdIterator
A wrapper of the STL "map" container.
InputMeshType::CellIdentifier CellIdentifier
InputMeshType::PointType InputPointType
InputCellType::MultiVisitor CellMultiVisitorType
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
itk::MapContainer< CellIdentifier, double > DoubleValueMapType
DoubleValueMapType::Iterator DoubleContainerIterator
double GetMaximumCellSize()
virtual PointIdIterator PointIdsEnd(void) override
ImageBaseType::SpacingType VectorType
double GetTotalMeanCurvature()
This filter changes the topology of a 2-simplex mesh.
CellMultiVisitorType::Pointer CellMultiVisitorPointer
static ITK_CONSTEXPR_FUNC T max(const T &)
void Visit(CellIdentifier cellId, InputPolygonType *poly)
visits all polygon cells and computes the area, NOTE: works for convex polygons only!!! ...
SmartPointer< const Self > ConstPointer
void operator=(const Self &)
The non-const iterator type for the map.
SmartPointer< Self > Pointer
DoubleValueMapType::Pointer areaMap
ImageBaseType::PointType PointType
InputMeshType::CellAutoPointer CellAutoPointer
InputMeshType::VectorType InputVectorType
SimplexVisitorInterfaceType::Pointer SimplexVisitorInterfacePointer
double ComputeArea(PointIdentifier p1, PointIdentifier p2, PointIdentifier p3)
virtual PointIdIterator PointIdsBegin(void) override
DoubleValueMapType::Pointer GetAreaMap()
InputPolygonType::PointIdIterator InputPolygonPointIdIterator
Represents a polygon in a Mesh.
InputMeshType::PixelType InputPixelType
InputMeshType::Pointer InputMeshPointer
InputMeshType::CellType InputCellType
itk::CellInterfaceVisitorImplementation< InputPixelType, InputCellTraitsType, InputPolygonType, SimplexCellVisitor > SimplexVisitorInterfaceType
OutputMeshType::Pointer OutputMeshPointer
InputMeshType::PointIdentifier PointIdentifier
SimplexMeshAdaptTopologyFilter Self
OutputMeshType::Pointer OutputMeshPointer
InputMeshType::MeshTraits::CellTraits InputCellTraitsType
itk::PolygonCell< InputCellType > InputPolygonType
double GetMinimumCellSize()
Control indentation during Print() invocation.
itk::PolygonCell< OutputCellType > OutputPolygonType
InputMeshType::Pointer InputMeshPointer
double GetTotalMeshArea()
OutputMeshType::CellType OutputCellType
A templated class holding a n-Dimensional covariant vector.
MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass
DoubleValueMapType::Pointer GetCurvatureMap()
double GetMaximumCurvature()
InputCellType::CellAutoPointer InputCellAutoPointer
TOutputMesh OutputMeshType