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 >
130 void Visit(CellIdentifier cellId, InputPolygonType *poly)
132 typename InputPolygonType::PointIdIterator it = poly->
PointIdsBegin();
134 double meanCurvature = 0;
135 PointIdentifier refPoint = *it;
136 double val = mesh->GetMeanCurvature(*it++);
139 PointIdentifier id1 = *it;
140 val = mesh->GetMeanCurvature(*it++);
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; }
173 double ComputeArea(PointIdentifier p1, PointIdentifier p2, PointIdentifier p3)
175 InputPointType v1, v2, v3;
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);
279 void ModifyNeighborCells(CellIdentifier id1, CellIdentifier id2, PointIdentifier insertPointId);
318 #ifndef ITK_MANUAL_INSTANTIATION 319 #include "itkSimplexMeshAdaptTopologyFilter.hxx" 322 #endif // itkSimplexMeshAdaptTopologyFilter_h
double GetMinimumCurvature()
CovariantVector< typename InputVectorType::ValueType, 3 > CovariantVectorType
A template class used to implement a visitor object.
CellIdentifier m_IdOffset
DoubleValueMapType::Pointer curvatureMap
void CopyInputMeshToOutputMeshGeometryData()
InputCellType::PointIdIterator InputCellPointIdIterator
A wrapper of the STL "map" container.
virtual void GenerateData() override
InputMeshType::CellIdentifier CellIdentifier
InputMeshType::PointType InputPointType
InputCellType::MultiVisitor CellMultiVisitorType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
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
double GetTotalMeanCurvature()
This filter changes the topology of a 2-simplex mesh.
CellMultiVisitorType::Pointer CellMultiVisitorPointer
SimplexMeshAdaptTopologyFilter(const Self &)
InputCellAutoPointer m_NewSimplexCellPointer
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 &)
SimplexMeshAdaptTopologyFilter()
The non-const iterator type for the map.
SmartPointer< Self > Pointer
DoubleValueMapType::Pointer areaMap
void PrintSelf(std::ostream &os, Indent indent) const override
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
void ComputeCellParameters()
Represents a polygon in a Mesh.
OutputMeshPointer m_Output
member for accessing the filter result during creation
void ModifyNeighborCells(CellIdentifier id1, CellIdentifier id2, PointIdentifier insertPointId)
InputMeshType::PixelType InputPixelType
InputMeshType::CellType InputCellType
itk::CellInterfaceVisitorImplementation< InputPixelType, InputCellTraitsType, InputPolygonType, SimplexCellVisitor > SimplexVisitorInterfaceType
OutputMeshType::Pointer OutputMeshPointer
InputMeshType::PointIdentifier PointIdentifier
SimplexMeshAdaptTopologyFilter Self
InputMeshType::MeshTraits::CellTraits InputCellTraitsType
~SimplexMeshAdaptTopologyFilter()
itk::PolygonCell< InputCellType > InputPolygonType
double GetMinimumCellSize()
Control indentation during Print() invocation.
InputPointType ComputeCellCenter(InputCellAutoPointer &simplexCell)
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