26 CPPUNIT_TEST_SUITE(mitkRTStructureSetReaderTestSuite);
29 CPPUNIT_TEST_SUITE_END();
40 CPPUNIT_ASSERT_MESSAGE(
"Failed to initialize RTStructureSetReader", m_rtStructureReader.IsNotNull());
43 void TestStructureSets()
45 std::deque<mitk::ContourModelSet::Pointer> contourModelVectorCorrect;
46 std::deque<mitk::ContourModelSet::Pointer> contourModelVectorCorrectSequ;
47 std::deque<mitk::DataNode::Pointer> contourModelVectorTest;
48 std::deque<mitk::ContourModelSet::Pointer> contourModelVectorTestDel;
50 LoadData(contourModelVectorCorrect);
52 contourModelVectorTest = m_rtStructureReader->ReadStructureSet(
GetTestDataFilePath(
"RT/StructureSet/RS.dcm").c_str());
56 for(
unsigned int i=0; i<contourModelVectorTest.size();++i)
58 if(dynamic_cast<mitk::ContourModelSet*>(contourModelVectorTest.at(i)->GetData())->GetSize()>0){
59 contourModelVectorTestDel.push_back(dynamic_cast<mitk::ContourModelSet*>(contourModelVectorTest.at(i)->GetData()));
64 for(
unsigned int i=0; i<contourModelVectorTestDel.size();++i)
67 for(
unsigned int j=0; j<contourModelVectorCorrect.size();++j)
70 if(tmp->GetValueAsString().compare(name->GetValueAsString()) == 0)
71 contourModelVectorCorrectSequ.push_back(contourModelVectorCorrect.at(j));
77 for(
unsigned int i=0;i<contourModelVectorCorrectSequ.size();++i)
79 if(!Compare(contourModelVectorCorrectSequ.at(i),contourModelVectorTestDel.at(i)))
83 CPPUNIT_ASSERT(equal);
87 if(c1->GetSize()!=c2->GetSize())
89 MITK_INFO <<
"Number of ContourModelSets different" << std::endl;
94 for(
int i=0;i<c1->GetSize();++i)
98 if(cm1->GetNumberOfVertices()!=cm2->GetNumberOfVertices())
100 MITK_INFO <<
"Number of Vertices different" << std::endl;
106 for(
int j=0;j<cm1->GetNumberOfVertices();++j)
110 if(fabs(p1[0]-p2[0]) > ep || fabs(p1[0]-p2[0]) > ep || fabs(p1[0]-p2[0]) > ep)
121 void LoadData(std::deque<mitk::ContourModelSet::Pointer> &r)
123 std::vector<itk::SmartPointer<mitk::BaseData> > readerOutput;
128 r.push_back(cnt_set);
133 r.push_back(cnt_set);
138 r.push_back(cnt_set);
143 r.push_back(cnt_set);
148 r.push_back(cnt_set);
153 r.push_back(cnt_set);
itk::SmartPointer< Self > Pointer
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 DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage)
Load a file into the given DataStorage.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.