16 #ifndef mitkToFTestingCOMMON_H
17 #define mitkToFTestingCOMMON_H
19 #include <MitkToFProcessingExports.h>
24 #include <itksys/SystemTools.hxx>
26 #include <vtkSmartPointer.h>
27 #include <vtkPolyData.h>
43 bool pointSetsEqual =
true;
44 if (pointSet1->GetSize()==pointSet2->GetSize())
46 for (
int i=0; i<pointSet1->GetSize(); i++)
52 std::cout << std::endl;
53 std::cout << std::setprecision(12) <<
"expected: " << expectedPoint;
54 std::cout << std::endl;
55 std::cout << std::setprecision(12) <<
"resultPoint: " << resultPoint;
56 std::cout << std::endl;
57 pointSetsEqual =
false;
63 pointSetsEqual =
false;
64 MITK_INFO<<
"Point sets have different size: "<<pointSet1->GetSize()<<
" vs. "<<pointSet2->GetSize();
66 return pointSetsEqual;
75 static bool VtkPolyDatasEqual( vtkSmartPointer<vtkPolyData> poly1, vtkSmartPointer<vtkPolyData> poly2 )
77 return PointSetsEqual(VtkPolyDataToMitkPointSet(poly1), VtkPolyDataToMitkPointSet(poly2));
88 int numberOfPoints = poly->GetNumberOfPoints();
89 for (
int i=0; i<numberOfPoints; i++)
91 double* currentPoint = poly->GetPoint(i);
93 point[0] = currentPoint[0];
94 point[1] = currentPoint[1];
95 point[2] = currentPoint[2];
96 result->InsertPoint(i,point);
DataCollection - Class to facilitate loading/accessing structured data.
static bool VtkPolyDatasEqual(vtkSmartPointer< vtkPolyData > poly1, vtkSmartPointer< vtkPolyData > poly2)
VtkPolyDatasEqual Convenience method for comparing the points of two vtkPolyData (using PointSetsEqua...
static bool PointSetsEqual(mitk::PointSet::Pointer pointSet1, mitk::PointSet::Pointer pointSet2)
PointSetsEqual Method two test if two point sets contain the same points. mitk::Equal is used for com...
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
static mitk::PointSet::Pointer VtkPolyDataToMitkPointSet(vtkSmartPointer< vtkPolyData > poly)
VtkPolyDataToMitkPointSet Converts a vtkPolyData into an mitkPointSet.