9 #include "imstkGeometryAlgorithm.h" 10 #include "imstkMath.h" 12 #include <vtkSmartPointer.h> 14 class vtkImplicitPolyDataDistance;
40 void setInputMesh(std::shared_ptr<SurfaceMesh> surfMesh);
42 std::shared_ptr<ImageData> getOutputImage();
55 void setDimensions(
int dimX,
int dimY,
int dimZ) { setDimensions(Vec3i(dimX, dimY, dimZ)); }
56 imstkGetMacro(Dimensions,
const Vec3i&);
65 void setBounds(
const Vec3d& min,
const Vec3d& max);
67 imstkGetMacro(Bounds,
const Vec6d&);
74 imstkGetMacro(NarrowBanded,
bool);
81 imstkGetMacro(DilateSize,
int);
86 imstkGetMacro(Tolerance,
double);
93 Vec3i m_Dimensions = Vec3i::Zero();
94 Vec6d m_Bounds = Vec6d::Zero();
95 double m_Tolerance = 1.0e-10;
97 bool m_NarrowBanded =
false;
100 vtkSmartPointer<vtkImplicitPolyDataDistance> m_distFunc;
imstkSetMacro(Dimensions, const Vec3i &)
Dimensions of distance transform to fill.
void setBounds(const Vec3d &min, const Vec3d &max)
Optionally one may specify bounds, if not specified bounds of the input SurfaceMesh is used...
Abstract base class for geometry algorithms. GeometryAlgorithms take N input geometries and produce N...
void requestUpdate() override
Users can implement this for the logic to be run.
This filter computes exact signed distance fields using octrees and pseudonormal computations. One might need to adjust the tolerance depending on dataset scale. The bounds for the image can be set in the filter, when none are set the bounding box of the mesh is used, the margin. When providing your own bounds a box larger than the original object might be necessary depending on shape.
Vec3d getNearestPoint(const Vec3d &pos)
Get the nearest point.
void setInputMesh(std::shared_ptr< SurfaceMesh > surfMesh)
Required input, port 0.