25 CPPUNIT_TEST_SUITE(mitkImageCastTestSuite);
26 MITK_TEST(Cast_ToMultipleConstItkImages_Succeeds);
27 MITK_TEST(Cast_ToMultipleNonConstItkImages_Fails);
28 CPPUNIT_TEST_SUITE_END();
40 unsigned int dimensions[] = {size, size, size};
41 mitkImage->Initialize(pixelType, 3, dimensions);
46 void Cast_ToMultipleConstItkImages_Succeeds()
50 CPPUNIT_ASSERT(mitkConstImage.IsNotNull());
52 typedef itk::Image<short, 3> ItkImageType;
55 mitk::ImageToItkImage<ItkImageType::PixelType, ItkImageType::ImageDimension>(mitkConstImage);
58 CPPUNIT_ASSERT((mitk::ImageToItkImage<ItkImageType::PixelType, ItkImageType::ImageDimension>(mitkConstImage)));
61 void Cast_ToMultipleNonConstItkImages_Fails()
66 CPPUNIT_ASSERT(mitkImage.IsNotNull());
68 typedef itk::Image<short, 3> ItkImageType;
71 mitk::ImageToItkImage<ItkImageType::PixelType, ItkImageType::ImageDimension>(mitkConstImage);
74 CPPUNIT_ASSERT_THROW((mitk::ImageToItkImage<ItkImageType::PixelType, ItkImageType::ImageDimension>(mitkImage)),
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
itk::SmartPointer< const Self > ConstPointer
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
itk::Image< TPixel, VDimension >::Pointer CreateTestImageFixedValue(vcl_size_t size, TPixel value)
Test fixture for parameterized tests.
Class for defining the data type of pixels.