15 #include "itkScalableAffineTransform.h" 35 originalPoint[0] = 1.0;
36 originalPoint[1] = 0.0;
37 originalPoint[2] = 0.0;
39 for (
int i = 0; i < 3; i++)
59 for (
int i = 0; i < 4; i++)
60 for (
int j = 0; j < 4; j++)
91 AffineTransform3D::Pointer transform = AffineTransform3D::New();
93 transform->SetOffset(offset);
94 transform->SetMatrix(rotation);
99 Point3D pointTransformedByAffineTransform3D = transform->TransformPoint(originalPoint);
102 bool pointCorrect =
true;
103 for (
int i = 0; i < 3; i++)
106 MITK_TEST_CONDITION(pointCorrect,
"Point has been correctly transformed by AffineTranform3D")
119 AffineTransform3D::Pointer transform = AffineTransform3D::New();
121 transform->SetOffset(offset);
122 transform->SetMatrix(rotation);
126 bool allElementsEqual =
true;
127 for (
int i = 0; i < 4; i++)
128 for (
int j = 0; j < 4; j++)
154 AffineTransform3D::Pointer transform = AffineTransform3D::New();
156 transform->SetOffset(offset);
157 transform->SetMatrix(rotation);
162 Point3D pointTransformedByAffineTransform3D = transform->TransformPoint(originalPoint);
168 bool pointsMatch =
true;
169 for (
int i = 0; i < 3; i++)
170 pointsMatch &=
Equal(pointTransformedByAffineTransform3D[i], pointTransformedByHomogenous[i]);
172 bool homogenousComponentCorrect =
Equal(1, pointTransformedByHomogenous[3]);
175 "Point transformed by AffineTransform and homogenous coordinates match")
DataCollection - Class to facilitate loading/accessing structured data.
void TransferItkTransformToVtkMatrix(const TTransformType *itkTransform, vtkMatrix4x4 *vtkmatrix)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_CONDITION(COND, MSG)
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.