7 #include "imstkSurfaceMeshFlyingEdges.h" 8 #include "imstkGeometryUtilities.h" 9 #include "imstkImageData.h" 10 #include "imstkLogger.h" 11 #include "imstkSurfaceMesh.h" 13 #include <vtkFlyingEdges3D.h> 14 #include <vtkImageData.h> 18 SurfaceMeshFlyingEdges::SurfaceMeshFlyingEdges()
21 setRequiredInputType<ImageData>(0);
24 setOutput(std::make_shared<SurfaceMesh>());
33 std::shared_ptr<SurfaceMesh>
34 SurfaceMeshFlyingEdges::getOutputMesh()
const 42 std::shared_ptr<ImageData> inputImage = std::dynamic_pointer_cast<
ImageData>(
getInput(0));
43 if (inputImage ==
nullptr)
45 LOG(WARNING) <<
"No inputImage to extract isosurface from";
49 vtkNew<vtkFlyingEdges3D> filter;
50 filter->SetInputData(GeometryUtils::coupleVtkImageData(inputImage));
51 filter->SetValue(0, m_IsoValue);
52 filter->ComputeNormalsOff();
53 filter->ComputeScalarsOff();
54 filter->ComputeGradientsOff();
std::shared_ptr< Geometry > getInput(size_t port=0) const
Returns input geometry given port, returns nullptr if doesn't exist.
std::unique_ptr< SurfaceMesh > clone()
Polymorphic clone, hides the declaration in superclass return own type.
void setNumOutputPorts(const size_t numPorts)
Get/Set the amount of output ports.
std::shared_ptr< Geometry > getOutput(size_t port=0) const
Returns output geometry given port, returns nullptr if doesn't exist.
void setInput(std::shared_ptr< Geometry > inputGeometry, size_t port=0)
Set the input at the port.
void setInputImage(std::shared_ptr< ImageData > inputImage)
Required input, port 0.
Represents a set of triangles & vertices via an array of Vec3d double vertices & Vec3i integer indice...
std::shared_ptr< SurfaceMesh > copyToSurfaceMesh(vtkSmartPointer< vtkPolyData > vtkMesh)
Converts vtk polydata into a imstk surface mesh.
void setOutput(std::shared_ptr< Geometry > inputGeometry, const size_t port=0)
Set the output at the port.
void setNumInputPorts(const size_t numPorts)
Get/Set the amount of input ports.
void requestUpdate() override
Users can implement this for the logic to be run.
Class to represent 1, 2, or 3D image data (i.e. structured points)