38 class mitkTimeGeometryTestClass
41 void Translation_Image_MovedOrigin(
unsigned int DimX,
unsigned int DimY,
unsigned int DimZ,
unsigned int DimT)
45 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
49 expectedOrigin[0] = 0;
50 expectedOrigin[1] = 0;
51 expectedOrigin[2] = 0;
54 expectedOrigin[0] = 0.325;
55 expectedOrigin[1] = 0.487;
56 expectedOrigin[2] = 0.78;
59 translationVector[0] = expectedOrigin[0];
60 translationVector[1] = expectedOrigin[1];
61 translationVector[2] = expectedOrigin[2];
63 for (
mitk::TimeStepType timeStep = 0; timeStep < image->GetTimeGeometry()->CountTimeSteps(); ++timeStep)
65 image->GetTimeGeometry()->GetGeometryForTimeStep(timeStep)->Translate(translationVector);
67 imageOrigin = image->GetGeometry(0)->GetOrigin();
70 expectedOrigin[0] = 2 * translationVector[0];
71 expectedOrigin[1] = 2 * translationVector[1];
72 expectedOrigin[2] = 2 * translationVector[2];
74 for (
mitk::TimeStepType timeStep = 0; timeStep < image->GetTimeGeometry()->CountTimeSteps(); ++timeStep)
76 image->GetTimeGeometry()->GetGeometryForTimeStep(timeStep)->Translate(translationVector);
78 imageOrigin = image->GetGeometry(0)->GetOrigin();
92 dataNode->SetData(baseData);
96 expectedPoint[0] = 3 * 0.5;
97 expectedPoint[1] = 3 * 0.33;
98 expectedPoint[2] = 3 * 0.78;
100 originalPoint[0] = 3;
101 originalPoint[1] = 3;
102 originalPoint[2] = 3;
104 geometry->IndexToWorld(originalPoint, worldPoint);
106 "Index-to-World without rotation as expected ");
109 pointOfRotation[0] = 0;
110 pointOfRotation[1] = 0;
111 pointOfRotation[2] = 0;
113 vectorOfRotation[0] = 1;
114 vectorOfRotation[1] = 0.5;
115 vectorOfRotation[2] = 0.2;
122 expectedPoint[0] = 2.6080379;
123 expectedPoint[1] = -0.75265157;
124 expectedPoint[2] = 1.1564401;
130 void Scale_Image_ScaledPoint(
unsigned int DimX,
unsigned int DimY,
unsigned int DimZ,
unsigned int DimT)
134 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
137 expectedPoint[0] = 3 * 0.5;
138 expectedPoint[1] = 3 * 0.33;
139 expectedPoint[2] = 3 * 0.78;
141 originalPoint[0] = 3;
142 originalPoint[1] = 3;
143 originalPoint[2] = 3;
145 geometry->IndexToWorld(originalPoint, worldPoint);
147 "Index-to-World with old Scaling as expected ");
151 newSpacing[1] = 1.254;
152 newSpacing[2] = 0.224;
153 image->SetSpacing(newSpacing);
154 expectedPoint[0] = 3 * 2;
155 expectedPoint[1] = 3 * 1.254;
156 expectedPoint[2] = 3 * 0.224;
158 image->GetGeometry(0)->IndexToWorld(originalPoint, worldPoint);
160 "Index-toWorld with new Scaling returns expected values ");
163 void GetMinimumTimePoint_4DBaseData_Zero(
mitk::BaseData *baseData,
unsigned int )
171 void GetMaximumTimePoint_4DBaseData_DimT(
mitk::BaseData *baseData,
unsigned int DimT)
179 void CountTimeSteps_Image_ReturnDimT(
180 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
196 "Returns correct minimum time point ");
208 MITK_INFO << std::numeric_limits<mitk::TimePointType>().
max();
210 "Returns correct maximum time point ");
213 void GetTimeBounds_4DImage_ZeroAndDimT(
unsigned int DimX,
unsigned int DimY,
unsigned int DimZ,
unsigned int DimT)
216 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
233 "Returns correct minimum time point ");
235 "Returns correct maximum time point ");
238 void IsValidTimePoint_ImageValidTimePoint_True(
239 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
243 bool isValid = geometry->IsValidTimePoint(DimT - 1);
247 void IsValidTimePoint_ImageNegativInvalidTimePoint_False(
unsigned int DimX,
253 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
255 bool isValid = geometry->IsValidTimePoint(-DimT);
259 void IsValidTimePoint_ImageInvalidTimePoint_False(
unsigned int DimX,
265 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
267 bool isValid = geometry->IsValidTimePoint(DimT + 1);
271 void IsValidTimeStep_ImageValidTimeStep_True(
272 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
275 bool isValid = geometry->IsValidTimeStep(DimT - 1);
279 void IsValidTimeStep_ImageNegativInvalidTimeStep_False(
280 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
283 bool isValid = geometry->IsValidTimeStep(-DimT);
287 void IsValidTimeStep_ImageInvalidTimeStep_False(
288 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
291 bool isValid = geometry->IsValidTimeStep(DimT);
295 void TimeStepToTimePoint_ImageValidTimeStep_TimePoint(
296 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
303 void TimeStepToTimePoint_ImageInvalidTimeStep_TimePoint(
304 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
311 void TimePointToTimeStep_ImageValidTimePoint_TimePoint(
312 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
319 void TimePointToTimeStep_4DImageInvalidTimePoint_TimePoint(
unsigned int DimX,
325 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
331 void TimePointToTimeStep_4DImageNegativInvalidTimePoint_TimePoint(
unsigned int DimX,
337 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
344 void GetGeometryForTimeStep_BaseDataValidTimeStep_CorrectGeometry(
mitk::BaseData *baseData,
359 expectedPoint[0] = outputX;
360 expectedPoint[1] = outputY;
361 expectedPoint[2] = outputZ;
363 originalPoint[0] = inputX;
364 originalPoint[1] = inputY;
365 originalPoint[2] = inputZ;
367 geometry3D->IndexToWorld(originalPoint, worldPoint);
371 void GetGeometryForTimeStep_ImageInvalidTimeStep_NullPointer(
372 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
379 void GetGeometryForTimePoint_BaseDataValidTimePoint_CorrectGeometry(
mitk::BaseData *baseData,
394 expectedPoint[0] = outputX;
395 expectedPoint[1] = outputY;
396 expectedPoint[2] = outputZ;
398 originalPoint[0] = inputX;
399 originalPoint[1] = inputY;
400 originalPoint[2] = inputZ;
402 geometry3D->IndexToWorld(originalPoint, worldPoint);
406 void GetGeometryForTimePoint_4DImageInvalidTimePoint_NullPointer(
unsigned int DimX,
412 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
415 MITK_TEST_CONDITION(geometry3D.IsNull(),
"Null-Pointer geometry returned with invalid time point");
418 void GetGeometryForTimePoint_4DImageNEgativInvalidTimePoint_NullPointer(
unsigned int DimX,
424 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
428 MITK_TEST_CONDITION(geometry3D.IsNull(),
"Null-Pointer geometry returned with invalid negativ time point");
431 void GetGeometryCloneForTimeStep_BaseDataValidTimeStep_CorrectGeometry(
mitk::BaseData *baseData,
unsigned int DimT)
439 originalPoint[0] = 3;
440 originalPoint[1] = 3;
441 originalPoint[2] = 3;
443 geometry3D->IndexToWorld(originalPoint, expectedPoint);
446 translationVector[0] = 5;
447 translationVector[1] = 8;
448 translationVector[2] = 7;
449 geometry3D->Translate(translationVector);
451 geometry3D = geometry->GetGeometryForTimeStep(DimT - 1);
452 geometry3D->IndexToWorld(originalPoint, worldPoint);
456 void GetGeometryCloneForTimeStep_ImageInvalidTimeStep_NullPointer(
457 mitk::BaseData *baseData,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int DimT)
464 void SetTimeStepGeometry_BaseDataValidTimeStep_CorrectGeometry(
mitk::BaseData *baseData,
476 translationVector[0] = 5;
477 translationVector[1] = 8;
478 translationVector[2] = 7;
479 geometry3D->Translate(translationVector);
481 geometry->SetTimeStepGeometry(geometry3D, DimT - 1);
484 expectedPoint[0] = 3 * scaleX + 5;
485 expectedPoint[1] = 3 * scaleY + 8;
486 expectedPoint[2] = 3 * scaleZ + 7;
488 originalPoint[0] = 3;
489 originalPoint[1] = 3;
490 originalPoint[2] = 3;
492 geometry->GetGeometryForTimeStep(DimT - 1)->IndexToWorld(originalPoint, worldPoint);
496 void Expand_BaseDataDoubleSize_SizeChanged(
mitk::BaseData *baseData,
unsigned int DimT)
499 MITK_TEST_CONDITION(geometry->CountTimeSteps() == DimT,
"Number of time Steps match expection. ");
501 geometry->Expand(DimT * 2);
502 MITK_TEST_CONDITION(geometry->CountTimeSteps() == DimT * 2,
"Number of time Steps match expection. ");
508 void CheckBounds_BaseData_PointsAsExpected(
mitk::BaseData *baseData,
521 expectedPoint[0] = minX;
522 expectedPoint[1] = minY;
523 expectedPoint[2] = minZ;
526 point = geometry->GetCornerPointInWorld(
true,
true,
true);
529 point = geometry->GetCornerPointInWorld(1);
530 expectedPoint[0] = minX;
531 expectedPoint[1] = minY;
532 expectedPoint[2] = maxZ;
534 point = geometry->GetCornerPointInWorld(
true,
true,
false);
537 point = geometry->GetCornerPointInWorld(2);
538 expectedPoint[0] = minX;
539 expectedPoint[1] = maxY;
540 expectedPoint[2] = minZ;
542 point = geometry->GetCornerPointInWorld(
true,
false,
true);
545 point = geometry->GetCornerPointInWorld(3);
546 expectedPoint[0] = minX;
547 expectedPoint[1] = maxY;
548 expectedPoint[2] = maxZ;
550 point = geometry->GetCornerPointInWorld(
true,
false,
false);
553 point = geometry->GetCornerPointInWorld(4);
554 expectedPoint[0] = maxX;
555 expectedPoint[1] = minY;
556 expectedPoint[2] = minZ;
558 point = geometry->GetCornerPointInWorld(
false,
true,
true);
561 point = geometry->GetCornerPointInWorld(5);
562 expectedPoint[0] = maxX;
563 expectedPoint[1] = minY;
564 expectedPoint[2] = maxZ;
566 point = geometry->GetCornerPointInWorld(
false,
true,
false);
569 point = geometry->GetCornerPointInWorld(6);
570 expectedPoint[0] = maxX;
571 expectedPoint[1] = maxY;
572 expectedPoint[2] = minZ;
574 point = geometry->GetCornerPointInWorld(
false,
false,
true);
577 point = geometry->GetCornerPointInWorld(7);
578 expectedPoint[0] = maxX;
579 expectedPoint[1] = maxY;
580 expectedPoint[2] = maxZ;
582 point = geometry->GetCornerPointInWorld(
false,
false,
false);
586 void CheckLength_BaseData_AsExpected(
mitk::BaseData *baseData,
double length,
double squareLength)
591 double dimension = geometry->GetDiagonalLengthInWorld();
594 dimension = geometry->GetDiagonalLength2InWorld();
598 void CheckPointInside_BaseDataPointInside_True(
mitk::BaseData *baseData,
608 expectedPoint[0] = pointX;
609 expectedPoint[1] = pointY;
610 expectedPoint[2] = pointZ;
611 bool isInside = geometry->IsWorldPointInside(expectedPoint);
615 void CheckPointInside_BaseDataPointOutside_False(
mitk::BaseData *baseData,
625 expectedPoint[0] = pointX;
626 expectedPoint[1] = pointY;
627 expectedPoint[2] = pointZ;
628 bool isInside = geometry->IsWorldPointInside(expectedPoint);
632 void CheckBounds_Image_AsSet(
unsigned int DimX,
unsigned int DimY,
unsigned int DimZ,
unsigned int DimT)
635 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(DimX, DimY, DimZ, DimT, 0.5, 0.33, 0.78, 100);
663 isEqual = isEqual &&
mitk::Equal(bound[0], minBoundX);
664 isEqual = isEqual &&
mitk::Equal(bound[1], maxBoundX);
665 isEqual = isEqual &&
mitk::Equal(bound[2], minBoundY);
666 isEqual = isEqual &&
mitk::Equal(bound[3], maxBoundY);
667 isEqual = isEqual &&
mitk::Equal(bound[4], minBoundZ);
668 isEqual = isEqual &&
mitk::Equal(bound[5], maxBoundZ);
673 void CheckExtent_BaseData_AsSet(
mitk::BaseData *baseData,
double extentX,
double extentY,
double extentZ)
693 pointSet->SetPoint(1, pointA);
694 pointSet->SetPoint(2, pointB);
695 pointSet->SetPoint(3, pointC);
716 mitkTimeGeometryTestClass testClass;
720 mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(30, 25, 20, 1, 0.5, 0.33, 0.78, 100);
721 testClass.Translation_Image_MovedOrigin(30, 25, 20, 1);
722 testClass.Rotate_Image_RotatedPoint(image->Clone(), 30, 25, 20, 1);
723 testClass.Scale_Image_ScaledPoint(30, 25, 20, 1);
724 testClass.CountTimeSteps_Image_ReturnDimT(image->Clone(), 30, 25, 20, 1);
725 testClass.GetMinimumTimePoint_3DImage_Min(image->Clone(), 30, 25, 20, 1);
726 testClass.GetMaximumTimePoint_3DImage_Max(image->Clone(), 30, 25, 20, 1);
727 testClass.GetTimeBounds_3DImage_ZeroAndDimT(image->Clone(), 30, 25, 20, 1);
728 testClass.IsValidTimePoint_ImageValidTimePoint_True(image->Clone(), 30, 25, 20, 1);
729 testClass.IsValidTimeStep_ImageValidTimeStep_True(image->Clone(), 30, 25, 20, 1);
730 testClass.IsValidTimeStep_ImageNegativInvalidTimeStep_False(image->Clone(), 30, 25, 20, 1);
731 testClass.IsValidTimeStep_ImageInvalidTimeStep_False(image->Clone(), 30, 25, 20, 1);
732 testClass.TimeStepToTimePoint_ImageValidTimeStep_TimePoint(image->Clone(), 30, 25, 20, 1);
733 testClass.TimeStepToTimePoint_ImageInvalidTimeStep_TimePoint(image->Clone(), 30, 25, 20, 1);
734 testClass.TimePointToTimeStep_ImageValidTimePoint_TimePoint(image->Clone(), 30, 25, 20, 1);
735 testClass.GetGeometryForTimeStep_BaseDataValidTimeStep_CorrectGeometry(
736 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 1);
737 testClass.GetGeometryForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 20, 1);
738 testClass.GetGeometryForTimePoint_BaseDataValidTimePoint_CorrectGeometry(
739 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 1);
740 testClass.GetGeometryCloneForTimeStep_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 1);
741 testClass.GetGeometryCloneForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 20, 1);
742 testClass.SetTimeStepGeometry_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 0.5, 0.33, 0.78, 1);
743 testClass.Expand_BaseDataDoubleSize_SizeChanged(image->Clone(), 1);
744 testClass.CheckBounds_BaseData_PointsAsExpected(
745 image->Clone(), -0.5 * 0.5, -0.5 * 0.33, -0.5 * 0.78, 29.5 * 0.5, 24.5 * 0.33, 19.5 * 0.78);
746 testClass.CheckLength_BaseData_AsExpected(image->Clone(), 23.160796233014466, 536.42248214721712);
747 testClass.CheckPointInside_BaseDataPointInside_True(image->Clone(), 10, 5, 5);
748 testClass.CheckPointInside_BaseDataPointOutside_False(image->Clone(), 100, 500, 100);
749 testClass.CheckBounds_Image_AsSet(30, 25, 20, 1);
750 testClass.CheckExtent_BaseData_AsSet(image->Clone(), 30 * 0.5, 25 * 0.33, 20 * 0.78);
753 image = mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(30, 25, 1, 1, 0.5, 0.33, 0.78, 100);
754 testClass.Translation_Image_MovedOrigin(30, 25, 1, 1);
755 testClass.Rotate_Image_RotatedPoint(image->Clone(), 30, 25, 1, 1);
756 testClass.Scale_Image_ScaledPoint(30, 25, 1, 1);
757 testClass.CountTimeSteps_Image_ReturnDimT(image->Clone(), 30, 25, 1, 1);
758 testClass.GetMinimumTimePoint_3DImage_Min(image->Clone(), 30, 25, 1, 1);
759 testClass.GetMaximumTimePoint_3DImage_Max(image->Clone(), 30, 25, 1, 1);
760 testClass.GetTimeBounds_3DImage_ZeroAndDimT(image->Clone(), 30, 25, 1, 1);
761 testClass.IsValidTimePoint_ImageValidTimePoint_True(image->Clone(), 30, 25, 1, 1);
762 testClass.IsValidTimeStep_ImageValidTimeStep_True(image->Clone(), 30, 25, 1, 1);
763 testClass.IsValidTimeStep_ImageNegativInvalidTimeStep_False(image->Clone(), 30, 25, 1, 1);
764 testClass.IsValidTimeStep_ImageInvalidTimeStep_False(image->Clone(), 30, 25, 1, 1);
765 testClass.TimeStepToTimePoint_ImageValidTimeStep_TimePoint(image->Clone(), 30, 25, 1, 1);
766 testClass.TimeStepToTimePoint_ImageInvalidTimeStep_TimePoint(image->Clone(), 30, 25, 1, 1);
767 testClass.TimePointToTimeStep_ImageValidTimePoint_TimePoint(image->Clone(), 30, 25, 1, 1);
768 testClass.GetGeometryForTimeStep_BaseDataValidTimeStep_CorrectGeometry(
769 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 1);
770 testClass.GetGeometryForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 1, 1);
771 testClass.GetGeometryForTimePoint_BaseDataValidTimePoint_CorrectGeometry(
772 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 1);
773 testClass.GetGeometryCloneForTimeStep_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 1);
774 testClass.GetGeometryCloneForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 1, 1);
775 testClass.SetTimeStepGeometry_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 0.5, 0.33, 0.78, 1);
776 testClass.Expand_BaseDataDoubleSize_SizeChanged(image->Clone(), 1);
777 testClass.CheckBounds_BaseData_PointsAsExpected(
778 image->Clone(), -0.5 * 0.5, -0.5 * 0.33, -0.5 * 0.78, 29.5 * 0.5, 24.5 * 0.33, 0.5 * 0.78);
779 testClass.CheckLength_BaseData_AsExpected(image->Clone(), 17.1368287615, 293.6709);
780 testClass.CheckPointInside_BaseDataPointInside_True(image->Clone(), 10, 5, 0);
781 testClass.CheckPointInside_BaseDataPointOutside_False(image->Clone(), 100, 500, 0.5);
782 testClass.CheckExtent_BaseData_AsSet(image->Clone(), 30 * 0.5, 25 * 0.33, 1 * 0.78);
785 image = mitk::ImageGenerator::GenerateRandomImage<mitk::ScalarType>(30, 25, 20, 5, 0.5, 0.33, 0.78, 100);
786 testClass.Translation_Image_MovedOrigin(30, 25, 20, 5);
787 testClass.Rotate_Image_RotatedPoint(image->Clone(), 30, 25, 20, 5);
788 testClass.Scale_Image_ScaledPoint(30, 25, 20, 5);
789 testClass.CountTimeSteps_Image_ReturnDimT(image->Clone(), 30, 25, 20, 5);
790 testClass.GetMinimumTimePoint_4DBaseData_Zero(image->Clone(), 5);
791 testClass.GetMaximumTimePoint_4DBaseData_DimT(image->Clone(), 5);
792 testClass.GetTimeBounds_4DImage_ZeroAndDimT(30, 25, 20, 5);
793 testClass.IsValidTimePoint_ImageValidTimePoint_True(image->Clone(), 30, 25, 20, 5);
794 testClass.IsValidTimePoint_ImageNegativInvalidTimePoint_False(30, 25, 20, 5);
795 testClass.IsValidTimePoint_ImageInvalidTimePoint_False(30, 25, 20, 5);
796 testClass.IsValidTimeStep_ImageValidTimeStep_True(image->Clone(), 30, 25, 20, 5);
797 testClass.IsValidTimeStep_ImageNegativInvalidTimeStep_False(image->Clone(), 30, 25, 20, 5);
798 testClass.IsValidTimeStep_ImageInvalidTimeStep_False(image->Clone(), 30, 25, 20, 5);
799 testClass.TimeStepToTimePoint_ImageValidTimeStep_TimePoint(image->Clone(), 30, 25, 20, 5);
800 testClass.TimeStepToTimePoint_ImageInvalidTimeStep_TimePoint(image->Clone(), 30, 25, 20, 5);
801 testClass.TimePointToTimeStep_ImageValidTimePoint_TimePoint(image->Clone(), 30, 25, 20, 5);
802 testClass.TimePointToTimeStep_4DImageInvalidTimePoint_TimePoint(30, 25, 20, 5);
803 testClass.TimePointToTimeStep_4DImageNegativInvalidTimePoint_TimePoint(30, 25, 20, 5);
804 testClass.GetGeometryForTimeStep_BaseDataValidTimeStep_CorrectGeometry(
805 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 5);
806 testClass.GetGeometryForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 20, 5);
807 testClass.GetGeometryForTimePoint_BaseDataValidTimePoint_CorrectGeometry(
808 image->Clone(), 3, 3, 3, 3 * 0.5, 3 * 0.33, 3 * 0.78, 5);
809 testClass.GetGeometryForTimePoint_4DImageInvalidTimePoint_NullPointer(30, 25, 20, 5);
810 testClass.GetGeometryForTimePoint_4DImageNEgativInvalidTimePoint_NullPointer(30, 25, 20, 5);
811 testClass.GetGeometryCloneForTimeStep_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 5);
812 testClass.GetGeometryCloneForTimeStep_ImageInvalidTimeStep_NullPointer(image->Clone(), 30, 25, 20, 5);
813 testClass.SetTimeStepGeometry_BaseDataValidTimeStep_CorrectGeometry(image->Clone(), 0.5, 0.33, 0.78, 5);
814 testClass.Expand_BaseDataDoubleSize_SizeChanged(image->Clone(), 5);
815 testClass.CheckBounds_BaseData_PointsAsExpected(
816 image->Clone(), -0.5 * 0.5, -0.5 * 0.33, -0.5 * 0.78, 29.5 * 0.5, 24.5 * 0.33, 19.5 * 0.78);
817 testClass.CheckLength_BaseData_AsExpected(image->Clone(), 23.160796233014466, 536.42248214721712);
818 testClass.CheckPointInside_BaseDataPointInside_True(image->Clone(), 10, 5, 5);
819 testClass.CheckPointInside_BaseDataPointOutside_False(image->Clone(), 100, 100, 500);
820 testClass.CheckBounds_Image_AsSet(30, 25, 20, 5);
821 testClass.CheckExtent_BaseData_AsSet(image->Clone(), 30 * 0.5, 25 * 0.33, 20 * 0.78);
835 pointSet->SetPoint(0, pointA);
836 pointSet->SetPoint(1, pointB);
837 pointSet->SetPoint(2, pointC);
838 testClass.CountTimeSteps_Image_ReturnDimT(pointSet->Clone(), 30, 25, 20, 1);
842 testClass.IsValidTimePoint_ImageValidTimePoint_True(pointSet->Clone(), 30, 25, 20, 1);
843 testClass.IsValidTimeStep_ImageValidTimeStep_True(pointSet->Clone(), 30, 25, 20, 1);
844 testClass.IsValidTimeStep_ImageNegativInvalidTimeStep_False(pointSet->Clone(), 30, 25, 20, 1);
845 testClass.IsValidTimeStep_ImageInvalidTimeStep_False(pointSet->Clone(), 30, 25, 20, 1);
846 testClass.TimeStepToTimePoint_ImageValidTimeStep_TimePoint(pointSet->Clone(), 30, 25, 20, 1);
847 testClass.TimeStepToTimePoint_ImageInvalidTimeStep_TimePoint(pointSet->Clone(), 30, 25, 20, 1);
848 testClass.TimePointToTimeStep_ImageValidTimePoint_TimePoint(pointSet->Clone(), 30, 25, 20, 1);
849 testClass.GetGeometryForTimeStep_BaseDataValidTimeStep_CorrectGeometry(pointSet->Clone(), 3, 3, 3, 3, 3, 3, 1);
850 testClass.GetGeometryForTimeStep_ImageInvalidTimeStep_NullPointer(pointSet->Clone(), 30, 25, 20, 1);
851 testClass.GetGeometryForTimePoint_BaseDataValidTimePoint_CorrectGeometry(pointSet->Clone(), 3, 3, 3, 3, 3, 3, 1);
852 testClass.GetGeometryCloneForTimeStep_BaseDataValidTimeStep_CorrectGeometry(pointSet->Clone(), 1);
853 testClass.GetGeometryCloneForTimeStep_ImageInvalidTimeStep_NullPointer(pointSet->Clone(), 30, 25, 20, 1);
854 testClass.SetTimeStepGeometry_BaseDataValidTimeStep_CorrectGeometry(pointSet->Clone(), 1, 1, 1, 1);
855 testClass.Expand_BaseDataDoubleSize_SizeChanged(pointSet->Clone(), 1);
856 testClass.CheckBounds_BaseData_PointsAsExpected(pointSet->Clone(), 1, 1, 1, 3, 3, 3);
857 testClass.CheckLength_BaseData_AsExpected(pointSet->Clone(), 3.46410161, 12);
858 testClass.CheckPointInside_BaseDataPointInside_True(pointSet->Clone(), 2, 2, 3);
859 testClass.CheckPointInside_BaseDataPointOutside_False(pointSet->Clone(), 4, 5, 1);
860 testClass.CheckBounds_BaseData_AsSet(pointSet->Clone(), 1, 3, 1, 3, 1, 3);
861 testClass.CheckExtent_BaseData_AsSet(pointSet->Clone(), 2, 2, 2);
static const mitk::ScalarType test_eps_square
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Base of all data objects.
int mitkTimeGeometryTest(int, char *[])
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
Constants for most interaction classes, due to the generic StateMachines.
#define MITK_TEST_OUTPUT(x)
Output some text.
static const mitk::ScalarType test_eps
virtual void ExecuteOperation(Operation *op) override
Executes the given operation on all time steps.
#define MITK_TEST_CONDITION(COND, MSG)
mitk::ScalarType TimePointType
std::vcl_size_t TimeStepType
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.
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm)...
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
Operation, that holds everything necessary for an rotation operation on mitk::BaseData.
BoundingBoxType::BoundsArrayType BoundsArrayType