diff --git a/testing/examples/CMakeLists.txt b/testing/examples/CMakeLists.txt index 0001920..83e2a6f 100644 --- a/testing/examples/CMakeLists.txt +++ b/testing/examples/CMakeLists.txt @@ -1,47 +1,47 @@ #----------------------------------------------------------------------------- # Setup the system information test. Write out some basic failsafe # information in case the test doesn't run. #----------------------------------------------------------------------------- SET(CORE_TEST_EXAMPLES ${EXECUTABLE_OUTPUT_PATH}/rttbExamplesTests) SET(TEST_DATA_ROOT ${RTTBTesting_SOURCE_DIR}/data) SET(TEMP ${RTTBTesting_BINARY_DIR}/temporary) #----------------------------------------------------------------------------- ADD_TEST(RTBioModelExampleTest ${CORE_TEST_EXAMPLES} RTBioModelExampleTest "${TEST_DATA_ROOT}/TestDVH/dvh_PTV_HIT.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT2.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT3.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_TV.txt" "${TEST_DATA_ROOT}/Virtuos/MPM_LR_ah/dvh_diff_trunk6.txt" "${TEST_DATA_ROOT}/Virtuos/MPM_LR_ah/dvh_diff_trunk8.txt") ADD_TEST(DVHCalculatorExampleTest ${CORE_TEST_EXAMPLES} DVHCalculatorExampleTest "${TEST_DATA_ROOT}/DICOM/StructureSet/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwoGridScaling.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwoGridScaling05.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantFiftyGridScaling01.dcm") ADD_TEST(RTDoseIndexTest ${CORE_TEST_EXAMPLES} RTDoseIndexTest "${TEST_DATA_ROOT}/TestDVH/dvh_test_TV.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT2.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT3.txt") ADD_TEST(RTDoseStatisticsTest ${CORE_TEST_EXAMPLES} RTDoseStatisticsTest "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo_withDoseGridScaling.dcm" "${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa101.dos.gz" "${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa000.vdx" "${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa101.pln") ADD_TEST(RTDVHTest ${CORE_TEST_EXAMPLES} RTDVHTest "${TEST_DATA_ROOT}/TestDVH/dvh_test.txt") ADD_TEST(DVHCalculatorExampleTest ${CORE_TEST_EXAMPLES} DVHCalculatorExampleTest "${TEST_DATA_ROOT}/DICOM/StructureSet/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo_withDoseGridScaling.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncrease3D.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncreaseX.dcm") ADD_TEST(RTBioModelScatterPlotExampleTest ${CORE_TEST_EXAMPLES} RTBioModelScatterPlotExampleTest "${TEST_DATA_ROOT}/TestDVH/dvh_PTV_HIT.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/TestDVH/dvh_test_TV.txt") ADD_TEST(VoxelizationValidationTest ${CORE_TEST_EXAMPLES} VoxelizationValidationTest "${TEST_DATA_ROOT}/DICOM/StructureSet/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncrease3D.dcm" "${TEST_DATA_ROOT}/boostMask/" "${TEST_DATA_ROOT}/OTBMask/") ADD_TEST(DoseStatisticsIOVirtuosTest ${CORE_TEST_EXAMPLES} DoseStatisticsIOVirtuosTest -"D:/data/Sarkom Daten anonymized and cleaned/0001663996_SarkomPatient2/0001663996_SarkomPatient2_000.vdx" -"D:/data/Sarkom Daten anonymized and cleaned/0001663996_SarkomPatient2/0001663996_SarkomPatient2_000.ctx.gz" -"D:/data/Sarkom Daten anonymized and cleaned/0001663996_SarkomPatient2/0001663996_SarkomPatient2_108.dos.gz" -"D:/data/Sarkom Daten anonymized and cleaned/0001663996_SarkomPatient2/0001663996_SarkomPatient2_108.pln" "RUECKENMARK") +"${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa000.vdx" +"${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa000.ctx.gz" +"${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa101.dos.gz" +"${TEST_DATA_ROOT}/Virtuos/MPM_LR_aa/MPM_LR_aa101.pln" "CTV") RTTB_CREATE_TEST_MODULE(rttbExamples DEPENDS RTTBCore RTTBAlgorithms RTTBMasks RTTBOTBMask RTTBBoostMask RTTBIndices RTTBDicomIO RTTBVirtuosIO RTTBOtherIO RTTBModels PACKAGE_DEPENDS Litmus) diff --git a/testing/examples/DoseStatisticsIOVirtuosTest.cpp b/testing/examples/DoseStatisticsIOVirtuosTest.cpp index fa69309..3056b51 100644 --- a/testing/examples/DoseStatisticsIOVirtuosTest.cpp +++ b/testing/examples/DoseStatisticsIOVirtuosTest.cpp @@ -1,115 +1,112 @@ // ----------------------------------------------------------------------- // 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: 922 $ (last changed revision) // @date $Date: 2015-04-07 06:53:37 +0200 (Di, 07 Apr 2015) $ (last change date) // @author $Author: hentsch $ (last changed by) */ // this file defines the rttbCoreTests for the test driver // and all it expects is that you have a function called RegisterTests #include #include -#include #include "litCheckMacros.h" #include "rttbBaseType.h" #include "rttbDoseStatistics.h" #include "rttbDoseStatisticsXMLWriter.h" #include "rttbGenericMaskedDoseIterator.h" #include "rttbDoseIteratorInterface.h" #include "rttbVirtuosPlanFileDoseAccessorGenerator.h" #include "rttbVirtuosDoseAccessor.h" #include "rttbVirtuosFileStructureSetGenerator.h" #include "rttbBoostMaskAccessor.h" -#include "rttbInvalidParameterException.h" -#include "rttbNullPointerException.h" namespace rttb { namespace testing { /*! @brief OtherIOTest - test the IO for dose statistics 1) test exception - 2) test writing statistcs to xml file + 2) test writing statistics to xml file */ int DoseStatisticsIOVirtuosTest(int argc, char* argv[]) { typedef core::GenericDoseIterator::DoseAccessorPointer DoseAccessorPointer; typedef core::DoseIteratorInterface::DoseIteratorPointer DoseIteratorPointer; typedef core::StructureSetGeneratorInterface::StructureSetPointer StructureSetPointer; typedef boost::shared_ptr DoseStatisticsPtr; typedef core::MaskAccessorInterface::MaskAccessorPointer MaskAccessorPointer; typedef boost::shared_ptr GeometricInfoPointer; PREPARE_DEFAULT_TEST_REPORTING; std::string Struct_FILENAME; std::string BPLCT_FILENAME; std::string Dose_FILENAME; std::string Plan_FILENAME; std::string Struct_NAME; if (argc > 5) { Struct_FILENAME = argv[1]; BPLCT_FILENAME = argv[2]; Dose_FILENAME = argv[3]; Plan_FILENAME = argv[4]; Struct_NAME = argv[5]; } else { std::cout << "at least 5 arguments are expected in DoseStatisticsIOVirtuosTest." << std::endl; } /* generate dummy dose */ io::virtuos::VirtuosPlanFileDoseAccessorGenerator doseAccessorGenerator(Dose_FILENAME.c_str(), Plan_FILENAME.c_str()); DoseAccessorPointer doseAccessor(doseAccessorGenerator.generateDoseAccessor()); StructureSetPointer rtStructureSet = io::virtuos::VirtuosFileStructureSetGenerator( Struct_FILENAME.c_str(), BPLCT_FILENAME.c_str()).generateStructureSet(); GeometricInfoPointer geometricInfoPtr = boost::make_shared(doseAccessor->getGeometricInfo()); MaskAccessorPointer maskAccessorPtr = boost::make_shared (rtStructureSet->getStructure(3), doseAccessor->getGeometricInfo()); maskAccessorPtr->updateMask(); boost::shared_ptr spTestDoseIterator = boost::make_shared(maskAccessorPtr, doseAccessor); DoseIteratorPointer spDoseIterator(spTestDoseIterator); rttb::algorithms::DoseStatistics myDoseStats(spDoseIterator); DoseStatisticsPtr myDoseStatsPtr = boost::make_shared (myDoseStats); /* test writing statistcs to xml file */ - FileNameString fN = "StatisticsSarkomPatient2.xml"; + FileNameString fN = "doseStatisticsVirtuos.xml"; CHECK_NO_THROW(io::other::writeDoseStatistics(myDoseStatsPtr, fN)); RETURN_AND_REPORT_TEST_SUCCESS; } }//testing }//rttb