20 #include "vtkPoints.h" 21 #include "vtkSmartPointer.h" 29 CPPUNIT_TEST_SUITE(mitkPointTypeConversionTestSuite);
41 CPPUNIT_TEST_SUITE_END();
44 vtkSmartPointer<vtkPoints> a_vtkPoints;
59 template <
typename T1,
typename T2>
62 CPPUNIT_ASSERT_EQUAL_MESSAGE(
63 "\nAssigning " + v2Name +
" to " + v1Name +
":\n both are equal",
true,
EqualArray(v1, v2, 3,
eps));
67 void setUp(
void)
override 72 a_vtkPoints = vtkSmartPointer<vtkPoints>::New();
73 a_vtkPoints->Initialize();
76 void tearDown(
void)
override 81 void Mitk2Itk_PointCompatibility()
85 itk::Point<ScalarType, 3> itkPoint3D = point3D;
87 TestForEquality(itkPoint3D, point3D,
"itk::Point",
"mitk:Point");
90 void Itk2Mitk_PointCompatibility()
92 itk::Point<ScalarType, 3> itkPoint3D = valuesToCopy;
96 TestForEquality(point3D, itkPoint3D,
"mitk:Point",
"itk::Point");
99 void Vtk2Mitk_PointCompatibility()
101 a_vtkPoints->InsertNextPoint(valuesToCopy);
103 a_vtkPoints->GetPoint(0, vtkPoint);
107 TestForEquality(point3D, vtkPoint,
"mitk:Point",
"vtkPoint");
110 void Mitk2Pod_PointCompatibility()
117 TestForEquality(podPoint, point3D,
"POD point",
"mitk::Point");
120 void Pod2Mitk_PointCompatibility()
124 itk::Point<double, 3> point3D = podPoint;
126 TestForEquality(point3D, podPoint,
"mitk::Point3D",
"POD point");
131 itk::Vector<double, 3> vector3D = originalValues;
133 itk::Point<double, 3> point3D = vector3D;
135 TestForEquality(point3D, vector3D,
"mitk::Point",
"mitk::Vector");
bool EqualArray(TArrayType1 &arrayType1, TArrayType2 &arrayType2, int size, ScalarType eps=mitk::eps, bool verbose=false)
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
DataCollection - Class to facilitate loading/accessing structured data.
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
void ToArray(ArrayType array) const
Test fixture for parameterized tests.
MITKCORE_EXPORT const ScalarType eps