23 #include "itkMatrix.h"
24 #include "itkVector.h"
27 #include <vtkCleanPolyData.h>
28 #include <vtkPolyData.h>
32 this->SetNumberOfIndexedOutputs(1);
41 if (m_InputSurface.IsNull())
43 this->SetNthOutput(0,
nullptr);
44 m_ErrorMessage =
"Error in SurfaceToPointSetFilter: Input is not set correctly.";
49 vtkPolyData *points = this->m_InputSurface->GetVtkPolyData();
51 cleaner->PieceInvariantOff();
52 cleaner->ConvertLinesToPointsOff();
53 cleaner->ConvertPolysToLinesOff();
54 cleaner->ConvertStripsToPolysOff();
55 cleaner->PointMergingOn();
56 cleaner->SetInputData(points);
59 vtkPolyData *mergedPoints = cleaner->GetOutput();
62 for (
int i = 0; i < mergedPoints->GetNumberOfPoints(); i++)
65 currentPoint[0] = mergedPoints->GetPoint(i)[0];
66 currentPoint[1] = mergedPoints->GetPoint(i)[1];
67 currentPoint[2] = mergedPoints->GetPoint(i)[2];
68 result->InsertPoint(i, currentPoint);
70 this->SetNthOutput(0, result);
78 m_InputSurface = InputSurface;
84 return this->m_ErrorMessage;
virtual void GenerateData() override
method generating the output of this filter. Called in the updated process of the pipeline...
void SetInput(mitk::Surface::Pointer m_InputSurface)
SurfaceToPointSetFilter()
~SurfaceToPointSetFilter()
std::string GetErrorMessage()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.