25 CPPUNIT_TEST_SUITE(mitkImageToUnstructuredGridFilterTestSuite);
26 MITK_TEST(testImageToUnstructuredGridFilterInitialization);
28 MITK_TEST(testUnstructuredGridGeneration);
30 CPPUNIT_TEST_SUITE_END();
42 void testImageToUnstructuredGridFilterInitialization()
45 CPPUNIT_ASSERT_MESSAGE(
"Testing instantiation of test object", testFilter.IsNotNull());
46 CPPUNIT_ASSERT_MESSAGE(
"Testing initialization of threshold member variable", testFilter->GetThreshold() == -0.1);
52 testFilter->SetInput(m_BallImage);
53 CPPUNIT_ASSERT_MESSAGE(
"Testing set / get input!", testFilter->GetInput() == m_BallImage);
56 void testUnstructuredGridGeneration()
59 testFilter->SetInput(m_BallImage);
61 CPPUNIT_ASSERT_MESSAGE(
"Testing UnstructuredGrid generation!", testFilter->GetOutput() != NULL);
67 testFilter1->SetInput(m_BallImage);
68 testFilter1->Update();
70 int numberOfPoints1 = testFilter1->GetNumberOfExtractedPoints();
73 testFilter2->SetInput(m_BallImage);
74 testFilter2->SetThreshold(1.0);
75 testFilter2->Update();
77 int numberOfPoints2 = testFilter2->GetNumberOfExtractedPoints();
79 CPPUNIT_ASSERT_MESSAGE(
"Testing Threshold", numberOfPoints1 > numberOfPoints2);
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
Test fixture for parameterized tests.
static mitk::Image::Pointer LoadImage(const std::string &path)
LoadImage Convenience method to load an arbitrary mitkImage.