diff --git a/testing/masks/CMakeLists.txt b/testing/masks/CMakeLists.txt index 6891453..65db7d6 100644 --- a/testing/masks/CMakeLists.txt +++ b/testing/masks/CMakeLists.txt @@ -1,28 +1,12 @@ MESSAGE (STATUS "Process All Mask Tests...") #----------------------------------------------------------------------------- # Include sub directories #----------------------------------------------------------------------------- ADD_SUBDIRECTORY(boost) IF(BUILD_Masks_Legacy) ADD_SUBDIRECTORY(legacy) -ENDIF() - -#----------------------------------------------------------------------------- -# Setup the system information test. Write out some basic failsafe -# information in case the test doesn't run. -#----------------------------------------------------------------------------- - -SET(Masks_TESTS ${EXECUTABLE_OUTPUT_PATH}/rttbMasksTests) - -SET(TEMP ${RTTBTesting_BINARY_DIR}/temporary) - -#----------------------------------------------------------------------------- -ADD_TEST(VOIindexIdentifierTest ${Masks_TESTS} VOIindexIdentifierTest -"${TEST_DATA_ROOT}/StructureSet/DICOM/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" ) - - -RTTB_CREATE_TEST_MODULE(rttbMasks DEPENDS RTTBDicomIO RTTBMasks PACKAGE_DEPENDS Boost Litmus RTTBData DCMTK) \ No newline at end of file +ENDIF() \ No newline at end of file diff --git a/testing/masks/VOIindexIdentifierTest.cpp b/testing/masks/VOIindexIdentifierTest.cpp deleted file mode 100644 index f56e7ef..0000000 --- a/testing/masks/VOIindexIdentifierTest.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// ----------------------------------------------------------------------- -// RTToolbox - DKFZ radiotherapy quantitative evaluation library -// -// Copyright (c) German Cancer Research Center (DKFZ), -// Software development for Integrated Diagnostics and Therapy (SIDT). -// ALL RIGHTS RESERVED. -// See rttbCopyright.txt or -// http://www.dkfz.de/en/sidt/projects/rttb/copyright.html [^] -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notices for more information. -// -//------------------------------------------------------------------------ -/*! -// @file -// @version $Revision: -// @date $Date: -// @author $Author: -*/ - -// this file defines the rttbCoreTests for the test driver -// and all it expects is that you have a function called RegisterTests - -#include "litCheckMacros.h" - -#include "rttbBaseType.h" -#include "rttbDicomFileStructureSetGenerator.h" -#include "rttbInvalidParameterException.h" -#include "rttbVOIindexIdentifier.h" - -namespace rttb -{ - - namespace testing - { - - int VOIindexIdentifierTest(int argc, char* argv[]) - { - PREPARE_DEFAULT_TEST_REPORTING; - - typedef core::StructureSetGeneratorInterface::StructureSetPointer StructureSetPointer; - - //ARGUMENTS: 1: structure file name - std::string RTSTRUCT_FILENAME; - - - if (argc > 1) - { - RTSTRUCT_FILENAME = argv[1]; - } - - StructureSetPointer rtStructureSet = io::dicom::DicomFileStructureSetGenerator( - RTSTRUCT_FILENAME.c_str()).generateStructureSet(); - - StructureSetPointer emptyPointer = StructureSetPointer(); - - CHECK_NO_THROW(::rttb::masks::VOIindexIdentifier testVOIindexId - = ::rttb::masks::VOIindexIdentifier()); - ::rttb::masks::VOIindexIdentifier testVOIindexId = ::rttb::masks::VOIindexIdentifier(); - - /* getIndexByVoiName */ - CHECK_THROW_EXPLICIT(testVOIindexId.getIndexByVoiName(emptyPointer, "Leber"), - ::rttb::core::Exception); - CHECK_THROW_EXPLICIT(testVOIindexId.getIndexByVoiName(rtStructureSet, "Invalid"), - ::rttb::core::Exception); - - unsigned int indexActual; - unsigned int indexExpected = 5; - - CHECK_NO_THROW(indexActual = testVOIindexId.getIndexByVoiName(rtStructureSet, "Leber")); - CHECK_EQUAL(indexActual, indexExpected); - - - /*getIndicesByVoiRegex*/ - CHECK_THROW_EXPLICIT(testVOIindexId.getIndicesByVoiRegex(emptyPointer, "Leber"), - ::rttb::core::Exception); - - std::vector vectorActual; - std::vector vectorExpected; - vectorExpected.push_back(5); - CHECK_NO_THROW(vectorActual = testVOIindexId.getIndicesByVoiRegex(rtStructureSet, "Leber")); - CHECK_EQUAL(vectorActual.size(), vectorExpected.size()); - CHECK_EQUAL(vectorActual.at(0), vectorExpected.at(0)); - - vectorExpected.clear(); - vectorExpected.push_back(2); - vectorExpected.push_back(3); - CHECK_NO_THROW(vectorActual = testVOIindexId.getIndicesByVoiRegex(rtStructureSet, "Niere.*")); - - CHECK_EQUAL(vectorActual.size(), vectorExpected.size()); - CHECK_EQUAL(vectorActual.at(0), vectorExpected.at(0)); - CHECK_EQUAL(vectorActual.at(1), vectorExpected.at(1)); - - CHECK_NO_THROW(vectorActual = testVOIindexId.getIndicesByVoiRegex(rtStructureSet, ".*")); - CHECK_EQUAL(vectorActual.size(), 10); - - for (size_t index = 0; index < vectorActual.size(); index++) - { - CHECK_EQUAL(vectorActual.at(index), index); - } - - /* getVoiNameByIndex */ - CHECK_THROW_EXPLICIT(testVOIindexId.getVoiNameByIndex(emptyPointer, 5), - ::rttb::core::Exception); - CHECK_THROW_EXPLICIT(testVOIindexId.getVoiNameByIndex(rtStructureSet, 20), ::rttb::core::Exception); - - CHECK_EQUAL(testVOIindexId.getVoiNameByIndex(rtStructureSet, 5), "Leber"); - - - RETURN_AND_REPORT_TEST_SUCCESS; - } - - }//testing -}//rttb - diff --git a/testing/masks/files.cmake b/testing/masks/files.cmake deleted file mode 100644 index b5c92ab..0000000 --- a/testing/masks/files.cmake +++ /dev/null @@ -1,7 +0,0 @@ -SET(CPP_FILES - VOIindexIdentifierTest.cpp - rttbMasksTests.cpp - ) - -SET(H_FILES -) diff --git a/testing/masks/rttbMasksTests.cpp b/testing/masks/rttbMasksTests.cpp deleted file mode 100644 index c13bce8..0000000 --- a/testing/masks/rttbMasksTests.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// ----------------------------------------------------------------------- -// RTToolbox - DKFZ radiotherapy quantitative evaluation library -// -// Copyright (c) German Cancer Research Center (DKFZ), -// Software development for Integrated Diagnostics and Therapy (SIDT). -// ALL RIGHTS RESERVED. -// See rttbCopyright.txt or -// http://www.dkfz.de/en/sidt/projects/rttb/copyright.html -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notices for more information. -// -//------------------------------------------------------------------------ -/*! -// @file -// @version $Revision$ (last changed revision) -// @date $Date$ (last change date) -// @author $Author$ (last changed by) -*/ - -// this file defines the rttbCoreTests for the test driver -// and all it expects is that you have a function called RegisterTests -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - - -#include "litMultiTestsMain.h" - -namespace rttb -{ - namespace testing - { - - void registerTests() - { - LIT_REGISTER_TEST(VOIindexIdentifierTest); - } - } -} - -int main(int argc, char* argv[]) -{ - int result = 0; - - rttb::testing::registerTests(); - - try - { - result = lit::multiTestsMain(argc, argv); - } - catch (const std::exception& /*e*/) - { - result = -1; - } - catch (...) - { - result = -1; - } - - return result; -}