18 #include <itkImageRegionIterator.h>
38 #include <vtkImageActor.h>
39 #include <vtkImageData.h>
40 #include <vtkImageMapToColors.h>
41 #include <vtkImageMapper.h>
42 #include <vtkImageReslice.h>
43 #include <vtkInteractorStyleImage.h>
44 #include <vtkLookupTable.h>
45 #include <vtkPlaneSource.h>
46 #include <vtkPolyDataMapper.h>
47 #include <vtkRenderWindow.h>
48 #include <vtkRenderWindowInteractor.h>
49 #include <vtkRenderer.h>
50 #include <vtkSmartPointer.h>
51 #include <vtkTexture.h>
69 #define Testfailure_Deviation_Mean_128 0.853842
71 #define Testfailure_Deviation_Volume_128 0.145184
72 #define Testfailure_Deviation_Diameter_128 1.5625
74 #define Testfailure_Deviation_Mean_256 0.397693
76 #define Testfailure_Deviation_Volume_256 0.0141357
77 #define Testfailure_Deviation_Diameter_256 0.78125
79 #define Testfailure_Deviation_Mean_512 0.205277
81 #define Testfailure_Deviation_Volume_512 0.01993
82 #define Testfailure_Deviation_Diameter_512 0.390625
84 class mitkExtractSliceFilterTestClass
89 TestPlane = planeGeometry;
93 mitk::ScalarType center[3] = {centerCoordValue, centerCoordValue, centerCoordValue};
96 double radius = TestvolumeSize / 4.0;
97 if (TestPlane->Distance(centerIndex) >= radius)
103 slicer->SetInput(TestVolume);
104 slicer->SetWorldGeometry(TestPlane);
125 std::string areatestName = TestName.append(
" area");
126 std::string diametertestName = TestName.append(
" testing diameter");
129 MITK_TEST_CONDITION(std::abs(100 - testResults.percentageAreaCalcToPixel) < 1, areatestName);
130 MITK_TEST_CONDITION(std::abs(100 - testResults.percentageRadiusToPixel) < 1, diametertestName);
132 #ifdef EXTRACTOR_DEBUG
134 <<
"planeDistanceToSphereCenter: " << testResults.planeDistanceToSphereCenter;
135 MITK_INFO <<
"area in pixels: " << testResults.areaInPixel <<
" <-> area in mm: " << testResults.areaCalculated
136 <<
" = " << testResults.percentageAreaCalcToPixel <<
"%";
138 MITK_INFO <<
"calculated diameter: " << testResults.diameterCalculated
139 <<
" <-> diameter in mm: " << testResults.diameterInMM
140 <<
" <-> diameter in pixel: " << testResults.diameterInPixel <<
" = "
141 << testResults.percentageRadiusToPixel <<
"%";
148 template <
typename TPixel,
unsigned int VImageDimension>
149 static void TestSphereRadiusByItk(itk::Image<TPixel, VImageDimension> *inputImage)
154 typename InputImageType::IndexType currentIndexX;
155 currentIndexX[0] = (int)(TestvolumeSize / 2.0);
156 currentIndexX[1] = 0;
158 typename InputImageType::IndexType currentIndexY;
159 currentIndexY[0] = 0;
160 currentIndexY[1] = (int)(TestvolumeSize / 2.0);
163 double lastValueX = inputImage->GetPixel(currentIndexX);
164 double lastValueY = inputImage->GetPixel(currentIndexY);
167 std::vector<typename InputImageType::IndexType> indicesX;
168 std::vector<typename InputImageType::IndexType> indicesY;
171 while (currentIndexX[1] < TestvolumeSize && currentIndexX[0] < TestvolumeSize)
174 currentIndexX[1] += 1;
177 currentIndexY[0] += 1;
179 if (inputImage->GetPixel(currentIndexX) > lastValueX)
182 typename InputImageType::IndexType markIndex;
183 markIndex[0] = currentIndexX[0];
184 markIndex[1] = currentIndexX[1];
186 indicesX.push_back(markIndex);
188 else if (inputImage->GetPixel(currentIndexX) < lastValueX)
191 typename InputImageType::IndexType markIndex;
192 markIndex[0] = currentIndexX[0];
193 markIndex[1] = currentIndexX[1] - 1;
195 indicesX.push_back(markIndex);
198 if (inputImage->GetPixel(currentIndexY) > lastValueY)
201 typename InputImageType::IndexType markIndex;
202 markIndex[0] = currentIndexY[0];
203 markIndex[1] = currentIndexY[1];
205 indicesY.push_back(markIndex);
207 else if (inputImage->GetPixel(currentIndexY) < lastValueY)
210 typename InputImageType::IndexType markIndex;
211 markIndex[0] = currentIndexY[0];
212 markIndex[1] = currentIndexY[1] - 1;
214 indicesY.push_back(markIndex);
218 if (indicesX.size() == 2 && indicesY.size() == 2)
222 lastValueX = inputImage->GetPixel(currentIndexX);
223 lastValueY = inputImage->GetPixel(currentIndexY);
234 double distanceToCenterX = std::abs(indicesX[0][1] - indicesX[1][1]) / 2.0;
238 typename InputImageType::IndexType centerX;
241 centerX[0] = indicesX[0][0];
242 centerX[1] = indicesX[0][1] + distanceToCenterX;
249 typename InputImageType::IndexType currentIndex(centerX);
250 lastValueX = inputImage->GetPixel(currentIndex);
254 std::vector<typename InputImageType::IndexType> diameterIndices;
257 while (currentIndex[1] < TestvolumeSize)
259 currentIndex[1] += 1;
261 if (inputImage->GetPixel(currentIndex) != lastValueX)
263 typename InputImageType::IndexType markIndex;
264 markIndex[0] = currentIndex[0];
265 markIndex[1] = currentIndex[1] - 1;
267 diameterIndices.push_back(markIndex);
272 lastValueX = inputImage->GetPixel(currentIndex);
275 currentIndex[1] -= sumpixels;
276 lastValueX = inputImage->GetPixel(currentIndex);
279 while (currentIndex[1] >= 0)
281 currentIndex[1] -= 1;
283 if (inputImage->GetPixel(currentIndex) != lastValueX)
285 typename InputImageType::IndexType markIndex;
286 markIndex[0] = currentIndex[0];
287 markIndex[1] = currentIndex[1];
289 diameterIndices.push_back(markIndex);
294 lastValueX = inputImage->GetPixel(currentIndex);
302 volumeCenter[0] = volumeCenter[1] = volumeCenter[2] = TestvolumeSize / 2.0;
304 double planeDistanceToSphereCenter = TestPlane->Distance(volumeCenter);
306 double sphereRadius = TestvolumeSize / 4.0;
309 double diameter = 2.0 * std::sqrt(std::pow(sphereRadius, 2) - std::pow(planeDistanceToSphereCenter, 2));
311 double percentageRadiusToPixel = 100 / diameter * sumpixels;
319 diameterPointRight[2] = diameterPointLeft[2] = 0.0;
321 diameterPointLeft[0] = diameterIndices[0][0];
322 diameterPointLeft[1] = diameterIndices[0][1];
324 diameterPointRight[0] = diameterIndices[1][0];
325 diameterPointRight[1] = diameterIndices[1][1];
328 TestVolume->GetGeometry()->IndexToWorld(diameterPointLeft, diameterPointLeft);
329 TestVolume->GetGeometry()->IndexToWorld(diameterPointRight, diameterPointRight);
332 double diameterInMM = ((diameterPointLeft * -1.0) + diameterPointRight).GetNorm();
334 testResults.diameterInMM = diameterInMM;
335 testResults.diameterCalculated = diameter;
336 testResults.diameterInPixel = sumpixels;
337 testResults.percentageRadiusToPixel = percentageRadiusToPixel;
338 testResults.planeDistanceToSphereCenter = planeDistanceToSphereCenter;
342 template <
typename TPixel,
unsigned int VImageDimension>
343 static void TestSphereAreaByItk(itk::Image<TPixel, VImageDimension> *inputImage)
346 typedef itk::ImageRegionConstIterator<InputImageType> ImageIterator;
348 ImageIterator imageIterator(inputImage, inputImage->GetLargestPossibleRegion());
349 imageIterator.GoToBegin();
351 int sumPixelsInArea = 0;
353 while (!imageIterator.IsAtEnd())
355 if (inputImage->GetPixel(imageIterator.GetIndex()) == pixelValueSet)
361 volumeCenter[0] = volumeCenter[1] = volumeCenter[2] = TestvolumeSize / 2.0;
363 double planeDistanceToSphereCenter = TestPlane->Distance(volumeCenter);
365 double sphereRadius = TestvolumeSize / 4.0;
368 double radius = std::sqrt(std::pow(sphereRadius, 2) - std::pow(planeDistanceToSphereCenter, 2));
370 double areaInMM = 3.14159265358979 * std::pow(radius, 2);
372 testResults.areaCalculated = areaInMM;
373 testResults.areaInPixel = sumPixelsInArea;
374 testResults.percentageAreaCalcToPixel = 100 / areaInMM * sumPixelsInArea;
384 static void PixelvalueBasedTest()
387 typedef itk::Image<unsigned short, 3>
ImageType;
389 typedef itk::ImageRegionConstIterator<ImageType> ImageIterator;
393 ImageType::IndexType start;
394 start[0] = start[1] = start[2] = 0;
396 ImageType::SizeType size;
397 size[0] = size[1] = size[2] = 32;
399 ImageType::RegionType imgRegion;
400 imgRegion.SetSize(size);
401 imgRegion.SetIndex(start);
403 image->SetRegions(imgRegion);
404 image->SetSpacing(1.0);
407 ImageIterator imageIterator(image, image->GetLargestPossibleRegion());
408 imageIterator.GoToBegin();
410 unsigned short pixelValue = 0;
413 while (!imageIterator.IsAtEnd())
415 image->SetPixel(imageIterator.GetIndex(), pixelValue);
437 typedef itk::Image<unsigned short, 3>
ImageType;
440 srand((
unsigned)time(0));
444 bool isFrontside =
true;
445 bool isRotated =
false;
455 plane->InitializeStandardPlane(imageInMitk->
GetGeometry(), orientation, sliceindex, isFrontside, isRotated);
459 normal = plane->GetNormal();
463 origin += normal * 0.5;
465 plane->SetOrigin(origin);
491 axis0 = plane->GetAxisVector(0);
492 axis1 = plane->GetAxisVector(1);
496 unsigned char n1 = 7;
497 unsigned char n2 = 13;
500 testPoint3DInWorld = planeOrigin + (axis0 * n1) + (axis1 * n2);
503 ImageType::IndexType testPoint3DInIndex;
512 slicer->SetInput(imageInMitk);
513 slicer->SetWorldGeometry(plane);
520 slice->GetGeometry()->WorldToIndex(testPoint3DInWorld, testPoint2DInIndex);
523 p[0] = testPoint2DInIndex[0];
524 p[1] = testPoint2DInIndex[1];
525 p[2] = testPoint2DInIndex[2];
526 slice->GetGeometry()->IndexToWorld(p, sliceIndexToWorld);
528 p[0] = testPoint3DInIndex[0];
529 p[1] = testPoint3DInIndex[1];
530 p[2] = testPoint3DInIndex[2];
534 testPoint2DIn2DIndex[0] = testPoint2DInIndex[0];
535 testPoint2DIn2DIndex[1] = testPoint2DInIndex[1];
539 VolumeReadAccessorType VolumeReadAccessor(imageInMitk);
540 SliceReadAccessorType SliceReadAccessor(slice);
543 unsigned short valueAt3DVolume = VolumeReadAccessor.GetPixelByIndex(testPoint3DInIndex);
544 unsigned short valueAtSlice = SliceReadAccessor.GetPixelByIndex(testPoint2DIn2DIndex);
548 MITK_TEST_CONDITION(valueAt3DVolume == valueAtSlice,
"comparing pixelvalues for orthogonal plane");
550 vtkSmartPointer<vtkImageData> imageInVtk = imageInMitk->
GetVtkImageData();
551 vtkSmartPointer<vtkImageData> sliceInVtk = slice->GetVtkImageData();
553 double PixelvalueByMitkOutput = sliceInVtk->GetScalarComponentAsDouble(n1, n2, 0, 0);
561 slicerWithVtkOutput->SetInput(imageInMitk);
562 slicerWithVtkOutput->SetWorldGeometry(plane);
563 slicerWithVtkOutput->SetVtkOutputRequest(
true);
565 slicerWithVtkOutput->Update();
566 vtkSmartPointer<vtkImageData> vtkImageByVtkOutput = slicerWithVtkOutput->GetVtkOutput();
567 double PixelvalueByVtkOutput = vtkImageByVtkOutput->GetScalarComponentAsDouble(n1, n2, 0, 0);
570 "testing convertion of image output vtk->mitk by reslicer");
573 #ifdef EXTRACTOR_DEBUG
575 <<
"TESTINFO index: " << sliceindex <<
" orientation: " << orientation <<
" frontside: " << isFrontside
576 <<
" rotated: " << isRotated;
578 <<
"slice index to world: " << sliceIndexToWorld;
580 <<
"image index to world: " << imageIndexToWorld;
583 <<
"vtk: slice: " << PixelvalueByMitkOutput <<
", image: " << valueVTKinImage;
586 <<
"testPoint3D InWorld" << testPoint3DInWorld <<
" is " << testPoint2DInIndex <<
" in 2D";
588 <<
"randoms: " << ((int)n1) <<
", " << ((int)n2);
590 <<
"point is inside plane: " << plane->IsInside(testPoint3DInWorld)
594 <<
"volume idx: " << testPoint3DInIndex <<
" = " << valueAt3DVolume;
596 <<
"volume world: " << testPoint3DInWorld <<
" = " << valueAt3DVolumeByWorld;
598 <<
"slice idx: " << testPoint2DInIndex <<
" = " << valueAtSlice;
601 curr[0] = curr[1] = curr[2] = 0;
603 for (
int i = 0; i < 32; ++i)
605 for (
int j = 0; j < 32; ++j)
608 if (SliceReadAccessor.GetPixelByIndex(curr) == valueAt3DVolume)
610 MITK_INFO <<
"\n" << valueAt3DVolume <<
" MATCHED mitk " << curr;
617 typedef itk::Image<unsigned short, 2> Image2DType;
621 typedef itk::ImageRegionConstIterator<Image2DType> Iterator2D;
623 Iterator2D iter(img, img->GetLargestPossibleRegion());
625 while (!iter.IsAtEnd())
627 if (img->GetPixel(iter.GetIndex()) == valueAt3DVolume)
628 MITK_INFO <<
"\n" << valueAt3DVolume <<
" MATCHED itk " << iter.GetIndex();
632 #endif // EXTRACTOR_DEBUG
636 static float randFloat()
638 return (((
float)rand() + 1.0) / ((
float)RAND_MAX + 1.0)) +
639 (((float)rand() + 1.0) / ((float)RAND_MAX + 1.0)) / ((
float)RAND_MAX + 1.0);
643 static void InitializeTestVolume()
648 ItkVolumeGeneration();
653 writer->SetInput(TestVolume);
658 filename <<
"C:\\home\\schroedt\\MITK\\Modules\\ImageExtraction\\Testing\\Data\\sphere_";
659 filename << TestvolumeSize;
662 file = filename.str();
664 writer->SetFileName(file);
666 #endif // SAVE_VOLUME
670 #ifndef CREATE_VOLUME // read from file
674 std::string filename = locator->FindFile(
"sphere_512.nrrd.mhd",
"Modules/ImageExtraction/Testing/Data");
680 #ifdef CALC_TESTFAILURE_DEVIATION
687 struct SliceProperties
689 double planeDistanceToSphereCenter;
691 double diameterInPixel;
692 double diameterCalculated;
693 double percentageRadiusToPixel;
694 double areaCalculated;
696 double percentageAreaCalcToPixel;
700 static double TestvolumeSize;
702 static std::string TestName;
703 static unsigned char pixelValueSet;
704 static SliceProperties testResults;
705 static double TestFailureDeviation;
711 static void ItkVolumeGeneration()
713 typedef itk::Image<unsigned char, 3> TestVolumeType;
715 typedef itk::ImageRegionConstIterator<TestVolumeType> ImageIterator;
719 TestVolumeType::IndexType start;
720 start[0] = start[1] = start[2] = 0;
722 TestVolumeType::SizeType size;
723 size[0] = size[1] = size[2] = TestvolumeSize;
725 TestVolumeType::RegionType imgRegion;
726 imgRegion.SetSize(size);
727 imgRegion.SetIndex(start);
729 sphereImage->SetRegions(imgRegion);
730 sphereImage->SetSpacing(1.0);
731 sphereImage->Allocate();
733 sphereImage->FillBuffer(0);
736 center[0] = center[1] = center[2] = TestvolumeSize / 2.0;
738 double radius = TestvolumeSize / 4.0;
740 double pixelValue = pixelValueSet;
742 ImageIterator imageIterator(sphereImage, sphereImage->GetLargestPossibleRegion());
743 imageIterator.GoToBegin();
747 while (!imageIterator.IsAtEnd())
749 currentVoxelInIndex[0] = imageIterator.GetIndex()[0];
750 currentVoxelInIndex[1] = imageIterator.GetIndex()[1];
751 currentVoxelInIndex[2] = imageIterator.GetIndex()[2];
753 double distanceToCenter = (center + (currentVoxelInIndex * -1.0)).GetNorm();
756 if (distanceToCenter < radius)
758 sphereImage->SetPixel(imageIterator.GetIndex(), pixelValue);
770 template <
typename TPixel,
unsigned int VImageDimension>
771 static void CalcTestFailureDeviation(itk::Image<TPixel, VImageDimension> *inputImage)
774 typedef itk::ImageRegionConstIterator<InputImageType> ImageIterator;
776 ImageIterator iterator(inputImage, inputImage->GetLargestPossibleRegion());
777 iterator.GoToBegin();
779 int volumeInPixel = 0;
781 while (!iterator.IsAtEnd())
783 if (inputImage->GetPixel(iterator.GetIndex()) == pixelValueSet)
788 double diameter = TestvolumeSize / 2.0;
789 double volumeCalculated = (1.0 / 6.0) * 3.14159265358979 * std::pow(diameter, 3);
791 double volumeDeviation = std::abs(100 - (100 / volumeCalculated * volumeInPixel));
793 typename InputImageType::IndexType index;
794 index[0] = index[1] = TestvolumeSize / 2.0;
798 while (index[2] < TestvolumeSize)
800 if (inputImage->GetPixel(index) == pixelValueSet)
805 double diameterDeviation = std::abs(100 - (100 / diameter * sumpixels));
807 MITK_INFO <<
"volume deviation: " << volumeDeviation <<
" diameter deviation:" << diameterDeviation;
809 mitkExtractSliceFilterTestClass::TestFailureDeviation = (volumeDeviation + diameterDeviation) / 2.0;
816 double mitkExtractSliceFilterTestClass::TestvolumeSize = 256.0;
818 std::string mitkExtractSliceFilterTestClass::TestName =
"";
819 unsigned char mitkExtractSliceFilterTestClass::pixelValueSet = 255;
820 mitkExtractSliceFilterTestClass::SliceProperties mitkExtractSliceFilterTestClass::testResults = {
821 -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0};
822 double mitkExtractSliceFilterTestClass::TestFailureDeviation = 0.0;
831 mitkExtractSliceFilterTestClass::PixelvalueBasedTest();
834 mitkExtractSliceFilterTestClass::InitializeTestVolume();
836 mitk::Vector3D spacing = mitkExtractSliceFilterTestClass::TestVolume->GetGeometry()->GetSpacing();
839 double sphereCenter = mitkExtractSliceFilterTestClass::TestvolumeSize / 2.0;
841 double planeSize = mitkExtractSliceFilterTestClass::TestvolumeSize;
845 geometryAxial->InitializeStandardPlane(
847 geometryAxial->ChangeImageGeometryConsideringOriginOffset(
true);
851 normal = geometryAxial->GetNormal();
855 origin += normal * 0.5;
859 mitkExtractSliceFilterTestClass::TestSlice(geometryAxial,
"Testing axial plane");
864 geometrySagital->InitializeStandardPlane(
866 geometrySagital->ChangeImageGeometryConsideringOriginOffset(
true);
868 origin = geometrySagital->GetOrigin();
869 normal = geometrySagital->GetNormal();
873 origin += normal * 0.5;
877 mitkExtractSliceFilterTestClass::TestSlice(geometrySagital,
"Testing sagittal plane");
882 geometrySagitalShifted->InitializeStandardPlane(
884 geometrySagitalShifted->ChangeImageGeometryConsideringOriginOffset(
true);
886 origin = geometrySagitalShifted->GetOrigin();
887 normal = geometrySagitalShifted->GetNormal();
891 origin += normal * 0.5;
895 mitkExtractSliceFilterTestClass::TestSlice(geometrySagitalShifted,
"Testing sagittal plane shifted");
900 geometryCoronal->InitializeStandardPlane(
902 geometryCoronal->ChangeImageGeometryConsideringOriginOffset(
true);
904 origin = geometryCoronal->GetOrigin();
905 normal = geometryCoronal->GetNormal();
909 origin += normal * 0.5;
913 mitkExtractSliceFilterTestClass::TestSlice(geometryCoronal,
"Testing coronal plane");
918 obliquePlane->InitializeStandardPlane(
920 obliquePlane->ChangeImageGeometryConsideringOriginOffset(
true);
922 origin = obliquePlane->GetOrigin();
923 normal = obliquePlane->GetNormal();
927 origin += normal * 0.5;
932 rotationVector[0] = 0.2;
933 rotationVector[1] = 0.4;
934 rotationVector[2] = 0.62;
940 obliquePlane->ExecuteOperation(op);
943 mitkExtractSliceFilterTestClass::TestSlice(obliquePlane,
"Testing oblique plane");
946 #ifdef SHOW_SLICE_IN_RENDER_WINDOW
954 slicer->SetInput(pic->GetVtkImageData());
957 obliquePl->InitializeStandardPlane(
959 obliquePl->ChangeImageGeometryConsideringOriginOffset(
true);
963 n = obliquePl->GetNormal();
969 obliquePl->SetOrigin(origin2);
972 rotation[0] = 0.534307;
973 rotation[1] = 0.000439605;
974 rotation[2] = 0.423017;
979 obliquePl->ExecuteOperation(operation);
983 origin[0] = obliquePl->GetOrigin()[0];
984 origin[1] = obliquePl->GetOrigin()[1];
985 origin[2] = obliquePl->GetOrigin()[2];
986 slicer->SetResliceAxesOrigin(origin);
989 right = obliquePl->GetAxisVector(0);
990 bottom = obliquePl->GetAxisVector(1);
991 normal = obliquePl->GetNormal();
1005 slicer->SetResliceAxesDirectionCosines(cosines);
1007 slicer->SetOutputDimensionality(2);
1012 vtkPlane->SetOrigin(0.0, 0.0, 0.0);
1017 vtkPlane->SetPoint1(1.0, 0.0, 0.0);
1018 vtkPlane->SetPoint2(0.0, 1.0, 0.0);
1022 imageMapper->SetInputConnection(vtkPlane->GetOutputPort());
1027 lookupTable->SetRampToLinear();
1028 lookupTable->SetSaturationRange(0.0, 0.0);
1029 lookupTable->SetHueRange(0.0, 0.0);
1030 lookupTable->SetValueRange(0.0, 1.0);
1031 lookupTable->Build();
1033 lookupTable->SetTableValue(0, 0.0, 0.0, 0.0, 0.0);
1034 lookupTable->SetRange(-255.0, 255.0);
1039 texture->SetInput(slicer->GetOutput());
1041 texture->SetLookupTable(lookupTable);
1043 texture->SetMapColorScalarsThroughLookupTable(
true);
1046 imageActor->SetMapper(imageMapper);
1047 imageActor->SetTexture(texture);
1051 renderer->AddActor(imageActor);
1055 renderWindow->AddRenderer(renderer);
1060 renderWindowInteractor->SetInteractorStyle(style);
1063 renderWindowInteractor->SetRenderWindow(renderWindow);
1066 renderWindow->Render();
1067 renderWindowInteractor->Start();
1070 #endif // SHOW_SLICE_IN_RENDER_WINDOW
itk::SmartPointer< Self > Pointer
Gives locked and index-based read access for a particular image part. The class provides several set-...
#define AccessFixedDimensionByItk(mitkImage, itkImageTypeFunction, dimension)
Access a mitk-image with known dimension by an itk-image.
itk::Image< unsigned char, 3 > ImageType
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
virtual vtkImageData * GetVtkImageData(int t=0, int n=0)
Get a volume at a specific time t of channel n as a vtkImageData.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
Constants for most interaction classes, due to the generic StateMachines.
itk::Image< double, 3 > InputImageType
#define MITK_TEST_CONDITION(COND, MSG)
void vnl2vtk(const vnl_vector< Tin > &in, Tout *out)
static const std::string filename
Image class for storing images.
void CastToMitkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, itk::SmartPointer< mitk::Image > &mitkoutputimage)
Cast an itk::Image (with a specific type) to an mitk::Image.
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)...
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
Describes a two-dimensional, rectangular plane.
bool IsInside(const mitk::Point3D &p) const
Test whether the point p (world coordinates in mm) is inside the bounding box.
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.
static StandardFileLocations * GetInstance()
static mitk::Image::Pointer LoadImage(const std::string &path)
LoadImage Convenience method to load an arbitrary mitkImage.
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.