23 CPPUNIT_TEST_SUITE(mitkRTDoseReaderServiceTestSuite);
26 CPPUNIT_TEST_SUITE_END();
36 m_referenceImage = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"RT/Dose/RT_Dose.nrrd"));
42 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"image should not be null", m_doseImage.IsNotNull(),
true);
43 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"reference image and image should be equal",
true,
mitk::Equal(*m_doseImage, *m_referenceImage,
mitk::eps,
true));
46 void TestProperties() {
47 CheckStringProperty(
"DICOM.0008.0060",
"RTDOSE");
50 double actualPrescribedDose = prescribedDoseGenericProperty->
GetValue();
51 double expectedPrescribedDose = 65535 * 0.0010494648*0.8;
52 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"prescribed dose property is not as expected", expectedPrescribedDose, actualPrescribedDose, 1e-5);
53 CheckStringProperty(
"DICOM.0020.000D",
"1.2.826.0.1.3680043.8.176.2013826104517910.408.3433258507");
54 CheckStringProperty(
"DICOM.3004.000E",
"0.0010494648");
55 CheckStringProperty(
"DICOM.300C.0002.[0].0008.1155",
"1.2.826.0.1.3680043.8.176.2013826104526987.672.1228523524");
58 void CheckStringProperty(
const std::string& propertyName,
const std::string& expectedPropertyValue)
60 auto actualProperty = m_doseImage->GetProperty(propertyName.c_str());
61 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Property not found: " + propertyName, actualProperty.IsNotNull(),
true);
63 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Property has not type string: " + propertyName, actualTemporoSpatialStringProperty !=
nullptr,
true);
64 std::string actualStringProperty = actualTemporoSpatialStringProperty->GetValue();
65 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.
virtual T GetValue() const
Test fixture for parameterized tests.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
static const std::string PRESCRIBED_DOSE_PROPERTY_NAME
MITKCORE_EXPORT const ScalarType eps
Property for time and space resolved string values.