27 CPPUNIT_TEST_SUITE(mitkProportionalTimeGeometryTestSuite);
29 MITK_TEST(TestProportionalTimeGeometryCloning);
30 CPPUNIT_TEST_SUITE_END();
33 void setUp()
override {}
34 void tearDown()
override {}
36 void TestInheritance()
40 CPPUNIT_ASSERT_MESSAGE(
"ProportionalTimeGeometry should not be castable to Geometry3D", g3d.IsNull());
43 CPPUNIT_ASSERT_MESSAGE(
"ProportionalTimeGeometry should be castable to TimeGeometry", base.IsNotNull());
46 void TestProportionalTimeGeometryCloning()
51 CPPUNIT_ASSERT_MESSAGE(
"First time point of clone matches original", clone->GetFirstTimePoint() == 1.1);
52 CPPUNIT_ASSERT_MESSAGE(
"Step duration of clone matches original", clone->GetStepDuration() == 2.2);
56 CPPUNIT_ASSERT_MESSAGE(
"Matrix element [0][0] of clone matches original", matrix[0][0] == 31);
58 double origin = planeGeom->
GetOrigin()[0];
59 CPPUNIT_ASSERT_MESSAGE(
"First Point of origin of clone matches original",
mitk::Equal(origin, 8));
62 CPPUNIT_ASSERT_MESSAGE(
"First Point of spacing of clone matches original",
mitk::Equal(spacing, 31));
79 itk::Matrix<mitk::ScalarType, 3, 3> transMatrix;
81 transMatrix[0][0] = 1;
82 transMatrix[1][1] = 2;
83 transMatrix[2][2] = 4;
85 myTransform->SetMatrix(transMatrix);
88 geom2D->SetIndexToWorldTransform(myTransform);
89 geom2D->SetSpacing(mySpacing);
90 geom2D->SetOrigin(myOrigin);
93 geom->SetFirstTimePoint(1.1);
94 geom->SetStepDuration(2.2);
95 geom->SetTimeStepGeometry(geom2D, 0);
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
itk::SmartPointer< Self > Pointer
Standard implementation of BaseGeometry.
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
static void clone(T *&dst, S *src, int n)
Test fixture for parameterized tests.
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.
Describes a two-dimensional, rectangular plane.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.