21 CPPUNIT_TEST_SUITE(mitkImageToUnstructuredGridFilterTestSuite);
22 MITK_TEST(testImageToUnstructuredGridFilterInitialization);
24 MITK_TEST(testUnstructuredGridGeneration);
26 CPPUNIT_TEST_SUITE_END();
37 void setUp()
override { m_BallImage = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"BallBinary30x30x30.nrrd")); }
38 void testImageToUnstructuredGridFilterInitialization()
41 CPPUNIT_ASSERT_MESSAGE(
"Testing instantiation of test object", testFilter.IsNotNull());
42 CPPUNIT_ASSERT_MESSAGE(
"Testing initialization of threshold member variable", testFilter->GetThreshold() == -0.1);
48 testFilter->SetInput(m_BallImage);
49 CPPUNIT_ASSERT_MESSAGE(
"Testing set / get input!", testFilter->GetInput() == m_BallImage);
52 void testUnstructuredGridGeneration()
55 testFilter->SetInput(m_BallImage);
57 CPPUNIT_ASSERT_MESSAGE(
"Testing UnstructuredGrid generation!", testFilter->GetOutput() !=
nullptr);
63 testFilter1->SetInput(m_BallImage);
64 testFilter1->Update();
66 int numberOfPoints1 = testFilter1->GetNumberOfExtractedPoints();
69 testFilter2->SetInput(m_BallImage);
70 testFilter2->SetThreshold(1.0);
71 testFilter2->Update();
73 int numberOfPoints2 = testFilter2->GetNumberOfExtractedPoints();
75 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.