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<
class TInputMesh,
class 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++);
137 meanCurvature += vcl_abs(val);
140 val = mesh->GetMeanCurvature(*it++);
141 meanCurvature += vcl_abs(val);
152 area += ComputeArea(refPoint, id1, id2);
154 val = mesh->GetMeanCurvature(*it);
155 meanCurvature += vcl_abs(val);
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 vcl_abs (
itk_cross_3d( ( v2 - v1 ).GetVnlVector(), ( v3 - v1 ).GetVnlVector() ).two_norm() / 2.0);
197 double GetTotalMeshArea()
202 double GetTotalMeanCurvature()
204 return totalCurvature / ( curvatureMap->Size() );
207 double GetMaximumCellSize()
212 double GetMinimumCellSize()
217 double GetMaximumCurvature()
222 double GetMinimumCurvature()
239 itkSetMacro(Threshold,
double);
240 itkGetConstMacro(Threshold,
double);
242 itkSetMacro(SelectionMethod,
int);
243 itkGetConstMacro(SelectionMethod,
int);
245 itkGetConstMacro(ModifiedCount,
int);
254 void PrintSelf(std::ostream & os,
Indent indent)
const;
256 virtual void GenerateData();
268 void ComputeCellParameters();
271 void CopyInputMeshToOutputMeshGeometryData();
278 void ModifyNeighborCells(CellIdentifier id1, CellIdentifier id2, PointIdentifier insertPointId);
283 InputPointType ComputeCellCenter(InputCellAutoPointer & simplexCell);
317 #ifndef ITK_MANUAL_INSTANTIATION
318 #include "itkSimplexMeshAdaptTopologyFilter.hxx"
321 #endif // __itkSimplexMeshAdaptTopologyFilter_h