25 CPPUNIT_TEST_SUITE(mitkDICOMPropertyTestSuite);
30 CPPUNIT_TEST_SUITE_END();
46 std::string simplePathStr;
47 std::string deepPathStr;
48 std::string deepPath2Str;
49 std::string deepPath_withSelectionStr;
75 data->GetPropertyList()->SetStringProperty(simplePathStr.c_str(),
"simplePath");
76 data->GetPropertyList()->SetStringProperty(deepPathStr.c_str(),
"deepPath");
77 data->GetPropertyList()->SetStringProperty(deepPath2Str.c_str(),
"deepPath2");
78 data->GetPropertyList()->SetStringProperty(deepPath_withSelectionStr.c_str(),
"deepPath_withSelection");
79 data->GetPropertyList()->SetStringProperty(
"DICOM.0003.0003",
"otherPath");
80 data->GetPropertyList()->SetStringProperty(
"not_a_dicom_prop",
"not_a_dicom_prop");
83 void tearDown()
override
90 CPPUNIT_ASSERT(result.size() == 1);
91 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"simplePath"));
94 CPPUNIT_ASSERT(result.size() == 1);
95 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"deepPath"));
98 CPPUNIT_ASSERT(result.size() == 1);
99 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"deepPath2"));
102 CPPUNIT_ASSERT(result.size() == 3);
103 CPPUNIT_ASSERT_EQUAL(result[deepPathStr]->GetValueAsString(), std::string(
"deepPath"));
104 CPPUNIT_ASSERT_EQUAL(result[deepPath2Str]->GetValueAsString(), std::string(
"deepPath2"));
105 CPPUNIT_ASSERT_EQUAL(result[deepPath_withSelectionStr]->GetValueAsString(), std::string(
"deepPath_withSelection"));
108 CPPUNIT_ASSERT(result.size() == 1);
109 CPPUNIT_ASSERT_EQUAL(result[deepPath_withSelectionStr]->GetValueAsString(), std::string(
"deepPath_withSelection"));
112 CPPUNIT_ASSERT(result.size() == 0);
115 CPPUNIT_ASSERT(result.size() == 0);
119 void GetPropertyByDICOMTagPath_2()
122 CPPUNIT_ASSERT(result.size() == 1);
123 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"simplePath"));
126 CPPUNIT_ASSERT(result.size() == 1);
127 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"deepPath"));
130 CPPUNIT_ASSERT(result.size() == 1);
131 CPPUNIT_ASSERT_EQUAL(result.begin()->second->GetValueAsString(), std::string(
"deepPath2"));
134 CPPUNIT_ASSERT(result.size() == 3);
135 CPPUNIT_ASSERT_EQUAL(result[deepPathStr]->GetValueAsString(), std::string(
"deepPath"));
136 CPPUNIT_ASSERT_EQUAL(result[deepPath2Str]->GetValueAsString(), std::string(
"deepPath2"));
137 CPPUNIT_ASSERT_EQUAL(result[deepPath_withSelectionStr]->GetValueAsString(), std::string(
"deepPath_withSelection"));
140 CPPUNIT_ASSERT(result.size() == 1);
141 CPPUNIT_ASSERT_EQUAL(result[deepPath_withSelectionStr]->GetValueAsString(), std::string(
"deepPath_withSelection"));
144 CPPUNIT_ASSERT(result.size() == 0);
147 CPPUNIT_ASSERT(result.size() == 0);
DICOMTagPath & AddElement(unsigned int group, unsigned int element)
DICOMTagPath & AddAnySelection(unsigned int group, unsigned int element)
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag...
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
DICOMTagPath & AddAnyElement()
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath &tagPath)
Test fixture for parameterized tests.
DICOMTagPath & AddSelection(unsigned int group, unsigned int element, ItemSelectionIndex index)
MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer > GetPropertyByDICOMTagPath(const PropertyList *list, const DICOMTagPath &path)