16 #include "mitkRTPlanReader.h" 23 CPPUNIT_TEST_SUITE(mitkRTPlanReaderTestSuite);
25 CPPUNIT_TEST_SUITE_END();
34 auto rtPlanReader = mitk::RTPlanReader();
36 auto readerOutput = rtPlanReader.Read();
37 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"reader output should have one entry.", static_cast<unsigned int>(1), static_cast<unsigned int>(readerOutput.size()));
39 m_image =
dynamic_cast<mitk::Image*
>(readerOutput.at(0).GetPointer());
40 CPPUNIT_ASSERT_EQUAL(m_image.IsNotNull(),
true);
45 CheckStringProperty(
"DICOM.300A.0010.[0].300A.0013",
"1.2.246.352.72.11.320687012.17740.20090508173031");
46 CheckStringProperty(
"DICOM.300A.0010.[1].300A.0013",
"1.2.246.352.72.11.320687012.17741.20090508173031");
47 CheckStringProperty(
"DICOM.300A.0010.[0].300A.0016",
"Breast");
48 CheckStringProperty(
"DICOM.300A.0010.[1].300A.0016",
"CALC POINT");
49 CheckStringProperty(
"DICOM.300A.0010.[0].300A.0026",
"14");
50 CheckStringProperty(
"DICOM.300A.0010.[1].300A.0026",
"11.3113869239676");
52 CheckStringProperty(
"DICOM.300A.0070.[0].300A.0078",
"7");
53 CheckStringProperty(
"DICOM.300A.0070.[0].300A.0080",
"4");
55 CheckStringProperty(
"DICOM.300A.00B0.[0].300A.00C6",
"PHOTON");
56 CheckStringProperty(
"DICOM.300A.00B0.[1].300A.00C6",
"PHOTON");
57 CheckStringProperty(
"DICOM.300A.00B0.[2].300A.00C6",
"PHOTON");
58 CheckStringProperty(
"DICOM.300A.00B0.[3].300A.00C6",
"PHOTON");
60 CheckStringProperty(
"DICOM.300C.0060.[0].0008.1155",
"1.2.246.352.71.4.320687012.3190.20090511122144");
63 void CheckStringProperty(std::string propertyName, std::string expectedPropertyValue)
65 auto actualProperty = m_image->GetProperty(propertyName.c_str());
66 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Property not found: " + propertyName, actualProperty.IsNotNull(),
true);
68 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Property has not type string: " + propertyName, actualTemporoSpatialStringProperty !=
nullptr,
true);
69 std::string actualStringProperty = actualTemporoSpatialStringProperty->GetValue();
70 CPPUNIT_ASSERT_EQUAL_MESSAGE(propertyName +
" is not as expected", actualStringProperty, expectedPropertyValue);
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.
Image class for storing images.
Test fixture for parameterized tests.
Property for time and space resolved string values.