23 CPPUNIT_TEST_SUITE(mitkProportionalTimeGeometryTestSuite);
25 MITK_TEST(TestProportionalTimeGeometryCloning);
26 CPPUNIT_TEST_SUITE_END();
29 void setUp()
override {}
30 void tearDown()
override {}
32 void TestInheritance()
36 CPPUNIT_ASSERT_MESSAGE(
"ProportionalTimeGeometry should not be castable to Geometry3D", g3d.IsNull());
39 CPPUNIT_ASSERT_MESSAGE(
"ProportionalTimeGeometry should be castable to TimeGeometry", base.IsNotNull());
42 void TestProportionalTimeGeometryCloning()
47 CPPUNIT_ASSERT_MESSAGE(
"First time point of clone matches original", clone->GetFirstTimePoint() == 1.1);
48 CPPUNIT_ASSERT_MESSAGE(
"Step duration of clone matches original", clone->GetStepDuration() == 2.2);
52 CPPUNIT_ASSERT_MESSAGE(
"Matrix element [0][0] of clone matches original", matrix[0][0] == 31);
54 double origin = planeGeom->
GetOrigin()[0];
55 CPPUNIT_ASSERT_MESSAGE(
"First Point of origin of clone matches original",
mitk::Equal(origin, 8));
58 CPPUNIT_ASSERT_MESSAGE(
"First Point of spacing of clone matches original",
mitk::Equal(spacing, 31));
74 mitk::AffineTransform3D::Pointer myTransform = mitk::AffineTransform3D::New();
75 itk::Matrix<mitk::ScalarType, 3, 3> transMatrix;
77 transMatrix[0][0] = 1;
78 transMatrix[1][1] = 2;
79 transMatrix[2][2] = 4;
81 myTransform->SetMatrix(transMatrix);
84 geom2D->SetIndexToWorldTransform(myTransform);
85 geom2D->SetSpacing(mySpacing);
86 geom2D->SetOrigin(myOrigin);
89 geom->SetFirstTimePoint(1.1);
90 geom->SetStepDuration(2.2);
91 geom->SetTimeStepGeometry(geom2D, 0);
Standard implementation of BaseGeometry.
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
static void clone(T *&dst, S *src, int n)
Test fixture for parameterized tests.
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
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.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
Describes a two-dimensional, rectangular plane.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.