diff --git a/code/io/dicom/files.cmake b/code/io/dicom/files.cmake index 8f2e3d8..76f1ec9 100644 --- a/code/io/dicom/files.cmake +++ b/code/io/dicom/files.cmake @@ -1,19 +1,21 @@ SET(CPP_FILES rttbDcmrtException.cpp rttbDicomDoseAccessor.cpp rttbDicomFileDoseAccessorGenerator.cpp + rttbDicomFileReaderHelper.cpp rttbDicomFileStructureSetGenerator.cpp rttbDicomIODDoseAccessorGenerator.cpp rttbDicomIODStructureSetGenerator.cpp rttbDVHDicomFileReader.cpp ) SET(H_FILES rttbDcmrtException.h rttbDicomDoseAccessor.h rttbDicomFileDoseAccessorGenerator.h + rttbDicomFileReaderHelper.h rttbDicomFileStructureSetGenerator.h rttbDicomIODDoseAccessorGenerator.h rttbDicomIODStructureSetGenerator.h rttbDVHDicomFileReader.h ) diff --git a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.cpp b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.cpp index af06a39..c7e1da2 100644 --- a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.cpp +++ b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.cpp @@ -1,76 +1,100 @@ // ----------------------------------------------------------------------- // 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) */ #include #include #include "rttbDicomFileDoseAccessorGenerator.h" #include "rttbDicomDoseAccessor.h" #include "rttbNullPointerException.h" #include "rttbInvalidDoseException.h" #include "rttbDcmrtException.h" #include "rttbIndexOutOfBoundsException.h" +#include "rttbDicomFileReaderHelper.h" +#include "rttbInvalidParameterException.h" namespace rttb{ namespace io{ namespace dicom{ DicomFileDoseAccessorGenerator::~DicomFileDoseAccessorGenerator(){} DicomFileDoseAccessorGenerator::DicomFileDoseAccessorGenerator(FileNameType aDICOMRTDoseFileName){ _dicomDoseFileName=aDICOMRTDoseFileName; } core::DoseAccessorGeneratorInterface::DoseAccessorPointer DicomFileDoseAccessorGenerator::generateDoseAccessor() { + std::vector fileVector; + + //if a file + if(isFile(_dicomDoseFileName)){ + fileVector.push_back(_dicomDoseFileName); + } + //if a directory + else if(isDirectory(_dicomDoseFileName)){ + rttb::io::dicom::Modality doseModality= {rttb::io::dicom::Modality::RTDOSE}; + fileVector = getFileNamesWithSameUID(_dicomDoseFileName, doseModality); + } + else{ + throw rttb::core::InvalidParameterException("Invalid file/directory name!"); + } + + if(fileVector.size()<1){ + throw rttb::core::InvalidParameterException("There is no structure set files in the directory!"); + } + OFCondition status; DcmFileFormat fileformat; + std::cout << _dicomDoseFileName << std::endl; + std::cout << fileVector.at(0) << std::endl; + DRTDoseIODPtr dose= boost::make_shared(); - status = fileformat.loadFile(_dicomDoseFileName.c_str()); + status = fileformat.loadFile(fileVector.at(0).c_str()); if (!status.good()) { - std::cerr << "Error: load rtdose loadFile("<<_dicomDoseFileName.c_str()<<") failed!"<(*fileformat.getDataset()); status = dose->read(*dataSet); if(!status.good()) { std::cerr << "Error: read DRTDoseIOD failed!"<(dose, dataSet); return _doseAccessor; } } } } diff --git a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h index be59786..b2cfa9a 100644 --- a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h +++ b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h @@ -1,77 +1,79 @@ // ----------------------------------------------------------------------- // 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) */ #ifndef __DICOM_FILE_DOSE_ACCESSOR_GENERATOR_H #define __DICOM_FILE_DOSE_ACCESSOR_GENERATOR_H #include #include #include #include "osconfig.h" /* make sure OS specific configuration is included first */ #include "drtdose.h" #include "rttbDoseAccessorGeneratorBase.h" #include "rttbBaseType.h" namespace rttb{ namespace io{ namespace dicom{ /*! @class DicomFileDoseAccessorGenerator @brief Load dose data from dicom file and generate DicomDoseAccessor. */ class DicomFileDoseAccessorGenerator: public core::DoseAccessorGeneratorBase { public: typedef boost::shared_ptr DRTDoseIODPtr; typedef boost::shared_ptr DcmItemPtr; private: FileNameType _dicomDoseFileName; DicomFileDoseAccessorGenerator(); protected: public: ~DicomFileDoseAccessorGenerator(); - /*! @brief Constructor. Initialisation with a DICOM-RT dose file with name aDICOMRTDoseFileName - + /*! @brief Constructor. Initialisation with a DICOM-RT dose file or a directory name + @param aDICOMRTDoseFileName a DICOM-RT dose file name or a directory name + @exception InvalidParameterException thrown if the file does not exist or the directory has no dicom dose file + @exception DcmrtException thrown if load and read file failed */ DicomFileDoseAccessorGenerator(FileNameType aDICOMRTDoseFileName); /*! @brief Generate DoseAccessor @return Return shared pointer of DoseAccessor. @exception InvalidDoseException Thrown if the loaded dose is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error */ DoseAccessorPointer generateDoseAccessor() ; }; } } } #endif diff --git a/code/io/dicom/rttbDicomFileReaderHelper.cpp b/code/io/dicom/rttbDicomFileReaderHelper.cpp new file mode 100644 index 0000000..20fdfaf --- /dev/null +++ b/code/io/dicom/rttbDicomFileReaderHelper.cpp @@ -0,0 +1,224 @@ +// ----------------------------------------------------------------------- +// 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: 707 $ (last changed revision) +// @date $Date: 2014-09-04 16:37:24 +0200 (Do, 04 Sep 2014) $ (last change date) +// @author $Author: floca $ (last changed by) +*/ + +#include "rttbDicomFileReaderHelper.h" + +#include +#include +#include +#include "boost/filesystem/operations.hpp" +#include "boost/filesystem/path.hpp" +#include "boost/progress.hpp" + +#include "rttbInvalidDoseException.h" +#include "rttbDcmrtException.h" +#include "rttbIndexOutOfBoundsException.h" +#include "rttbInvalidParameterException.h" + +namespace rttb{ + namespace io{ + namespace dicom{ + bool isFile(FileNameType aName){ + boost::filesystem::path path=boost::filesystem::path(aName); + if(boost::filesystem::exists(path) && boost::filesystem::is_regular_file(path)) + return true; + else + return false; + } + + bool isDirectory(FileNameType aName){ + boost::filesystem::path path=boost::filesystem::path(aName); + if(boost::filesystem::exists(path) && boost::filesystem::is_directory(path)) + return true; + else + return false; + } + + std::vector getFileNamesWithSameUID(FileNameType aDirName, Modality aModality){ + std::vector fileNameVector; + std::string modalityStrArray[] = {"RTDOSE", "RTSTRUCT", "RTPLAN"}; + + boost::filesystem::path path=boost::filesystem::path(aDirName); + + OFCondition status; + DcmFileFormat fileformat; + + IDType uid; + DcmDataSetPtr datasetPtr; + + int file_count=0; + if(!boost::filesystem::exists(path)){ + throw core::InvalidParameterException("Error: file/directory does not exist!"); + } + if(aModality.Type != 1 && aModality.Type != 2 && aModality.Type != 3){ + throw core::InvalidParameterException("Error: invalid modality! The modality should be RTDOSE(1)/RTSTRUCT(2)/RTPLAN(3)."); + } + + //if a directory + if(boost::filesystem::is_directory(path)){ + + boost::filesystem::directory_iterator end_iter; + bool isFirst=true; + + for(boost::filesystem::directory_iterator dir_itr(path);dir_itr!=end_iter;++dir_itr) + { + if(boost::filesystem::is_regular_file(dir_itr->status())) + { + boost::filesystem::path filePath(dir_itr->path().filename().string()); + filePath=boost::filesystem::system_complete(dir_itr->path()); + + status = fileformat.loadFile(filePath.string().c_str()); + if (!status.good()) + { + throw DcmrtException("Error: load dose fileformat.loadFile failed!"); + } + + datasetPtr = boost::make_shared(*fileformat.getDataset()); + OFString modalityOFS; + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0008, 0x0060), modalityOFS); + if (!status.good()) + { + throw DcmrtException("Error: get modality failed!"); + } + + + for(unsigned int i=0; i<3; i++){ + if (aModality.Type == (i+1) && modalityOFS == modalityStrArray[i].c_str()) + { + ++file_count; + OFString currentUID; + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0020, 0x000e), currentUID); + if (!status.good()) + { + throw DcmrtException("Error: get uid failed!"); + } + + //get the first uid of the given modality + if(file_count==1) + { + uid = currentUID.c_str(); + } + + + if(uid == currentUID.c_str()) + { + fileNameVector.push_back(filePath.string().c_str()); + } + + } + } + } + } + + } + else if(boost::filesystem::is_regular_file(path)){ + std::cout << "Important: the given name is a file name, not a directory name. Given modality will be ignored, use the modality of the file." << std::endl; + fileNameVector = getFileNames(aDirName); + } + else{ + throw core::InvalidParameterException("Error: file/directory does not exist!"); + } + return fileNameVector; + + } + + std::vector getFileNames(FileNameType aFileName){ + std::vector fileNameVector; + + boost::filesystem::path path=boost::filesystem::path(aFileName); + + OFCondition status; + DcmFileFormat fileformat; + DcmDataSetPtr datasetPtr; + OFString modality;//modality of the given file + OFString uid;//uid of the given file + + if(!boost::filesystem::exists(path) || !boost::filesystem::is_regular_file(path)){ + throw core::InvalidParameterException("Error: file does not exist!"); + } + + status = fileformat.loadFile(aFileName.c_str()); + if (!status.good()) + { + throw DcmrtException("Error: fileformat.loadFile failed!"); + } + + datasetPtr = boost::make_shared(*fileformat.getDataset()); + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0008, 0x0060), modality); + if (!status.good()) + { + throw DcmrtException("Error: get modality failed!"); + } + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0020, 0x000e), uid); + if (!status.good()) + { + throw DcmrtException("Error: get uid failed!"); + } + + //get parent directory + boost::filesystem::path parentDir = path.parent_path(); + if(boost::filesystem::is_directory(parentDir)){ + + boost::filesystem::directory_iterator end_iter; + + for(boost::filesystem::directory_iterator dir_itr(parentDir);dir_itr!=end_iter;++dir_itr) + { + if(boost::filesystem::is_regular_file(dir_itr->status())) + { + boost::filesystem::path currentFilePath(dir_itr->path().filename().string()); + currentFilePath = boost::filesystem::system_complete(dir_itr->path()); + + status = fileformat.loadFile(currentFilePath.string().c_str()); + if (!status.good()) + { + throw DcmrtException("Error: load dose fileformat.loadFile failed!"); + } + + datasetPtr = boost::make_shared(*fileformat.getDataset()); + OFString currentModality; + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0008, 0x0060), currentModality); + if (!status.good()) + { + throw DcmrtException("Error: get modality failed!"); + } + OFString currentUID; + status = datasetPtr->findAndGetOFString(DcmTagKey(0x0020, 0x000e), currentUID); + if (!status.good()) + { + throw DcmrtException("Error: get modality failed!"); + } + + //if the same modality + if (modality == currentModality && uid == currentUID){ + fileNameVector.push_back(currentFilePath.string().c_str()); + } + + } + + + } + } + return fileNameVector; + } + } + } +} + diff --git a/code/io/dicom/rttbDicomFileReaderHelper.h b/code/io/dicom/rttbDicomFileReaderHelper.h new file mode 100644 index 0000000..d778fe2 --- /dev/null +++ b/code/io/dicom/rttbDicomFileReaderHelper.h @@ -0,0 +1,79 @@ +// ----------------------------------------------------------------------- +// 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: 707 $ (last changed revision) +// @date $Date: 2014-09-04 16:37:24 +0200 (Do, 04 Sep 2014) $ (last change date) +// @author $Author: floca $ (last changed by) +*/ +#ifndef __DICOM_FILE_READER_HELPER_H +#define __DICOM_FILE_READER_HELPER_H + +#include +#include +#include + +#include "osconfig.h" /* make sure OS specific configuration is included first */ +#include "drtdose.h" + +#include "rttbBaseType.h" + + +namespace rttb{ + namespace io{ + namespace dicom{ + + struct Modality + { + enum Type + { + RTDOSE = 1, + RTSTRUCT = 2, + RTPLAN = 3, + UserDefined = 128 + } Type; + }; + + typedef boost::shared_ptr DRTDoseIODPtr; + typedef boost::shared_ptr DcmDataSetPtr; + + + /*! Return the vector of all files with the same UID in the given directory, the UID is defined by the first file with the modality. + @exception InvalidParameterException thrown if the file/directory does not exist or the modality is invalid + @exception DcmrtException thrown if load/read file failed + */ + std::vector getFileNamesWithSameUID(FileNameType aDirName, Modality aModality); + + /*! Return the vector of all files with the same UID in the directory of the given file + @exception InvalidParameterException thrown if the file does not exist + @exception DcmrtException thrown if load/read file failed + */ + std::vector getFileNames(FileNameType aFileName); + + /*! Return if the given name is a file + */ + bool isFile(FileNameType aName); + + /*! Return if the given name is a directory + */ + bool isDirectory(FileNameType aName); + + + }; + } +} + + +#endif diff --git a/code/io/dicom/rttbDicomFileStructureSetGenerator.cpp b/code/io/dicom/rttbDicomFileStructureSetGenerator.cpp index c6849c9..dca9196 100644 --- a/code/io/dicom/rttbDicomFileStructureSetGenerator.cpp +++ b/code/io/dicom/rttbDicomFileStructureSetGenerator.cpp @@ -1,76 +1,95 @@ // ----------------------------------------------------------------------- // 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) */ #include #include #include #include -//#include - #include "rttbInvalidParameterException.h" #include "rttbStructure.h" #include "rttbDicomFileStructureSetGenerator.h" #include "rttbDicomIODStructureSetGenerator.h" #include "rttbDcmrtException.h" - +#include "rttbDicomFileReaderHelper.h" namespace rttb{ namespace io{ namespace dicom{ DicomFileStructureSetGenerator::DicomFileStructureSetGenerator(DICOMRTFileNameString aDICOMRTStrSetFileName){ _fileName=aDICOMRTStrSetFileName; } DicomFileStructureSetGenerator::~DicomFileStructureSetGenerator() { } DicomFileStructureSetGenerator::StructureSetPointer DicomFileStructureSetGenerator::generateStructureSet(){ + std::vector fileVector; + + //if a file + if(isFile(_fileName)){ + fileVector.push_back(_fileName); + } + //if a directory + else if(isDirectory(_fileName)){ + rttb::io::dicom::Modality strModality= {rttb::io::dicom::Modality::RTSTRUCT}; + fileVector = getFileNamesWithSameUID(_fileName, strModality); + } + else{ + throw rttb::core::InvalidParameterException("Invalid file/directory name!"); + } + + if(fileVector.size()<1){ + throw rttb::core::InvalidParameterException("There is no structure set files in the directory!"); + } + OFCondition status; DcmFileFormat fileformat; DRTStrSetIODPtr drtStrSetIODPtr=boost::make_shared(); - status = fileformat.loadFile(_fileName.c_str()); + + //get the first structure set file + status = fileformat.loadFile(fileVector.at(0).c_str()); if (!status.good()) { throw DcmrtException("Load rt structure set loadFile() failed!"); } status = drtStrSetIODPtr->read(*fileformat.getDataset()); if(!status.good()) { throw DcmrtException("Read DRTStructureSetIOD DRTStructureSetIOD.read() failed!"); } return (boost::make_shared(drtStrSetIODPtr))->generateStructureSet(); } }//end namespace dicom }//end namespace io }//end namespace rttb diff --git a/code/io/dicom/rttbDicomFileStructureSetGenerator.h b/code/io/dicom/rttbDicomFileStructureSetGenerator.h index 6d7ae61..1ec34ff 100644 --- a/code/io/dicom/rttbDicomFileStructureSetGenerator.h +++ b/code/io/dicom/rttbDicomFileStructureSetGenerator.h @@ -1,82 +1,83 @@ // ----------------------------------------------------------------------- // 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) */ /* Changes in Architecture: The DICOM specific classes will be removed and transfered to the corresponding IO classes. This class should only provide general structure functionality. */ #ifndef __DICOM_FILE_STRUCTURE_SET_GENERATOR_H #define __DICOM_FILE_STRUCTURE_SET_GENERATOR_H #include #include #include "drtstrct.h" #include "rttbBaseType.h" #include "rttbStrVectorStructureSetGenerator.h" namespace rttb{ namespace io{ namespace dicom{ /*! @class DicomFileStructureSetGenerator @brief Generate a structure set from a corresponding dicomRT file. */ class DicomFileStructureSetGenerator: public core::StrVectorStructureSetGenerator { public: typedef core::StructureSet::StructTypePointer StructTypePointer; typedef StructureSetGeneratorInterface::StructureSetPointer StructureSetPointer; typedef boost::shared_ptr DRTStrSetIODPtr; private: IDType _UID; DICOMRTFileNameString _fileName; DicomFileStructureSetGenerator(){}; public: /*! @brief Constructor - @param aDICOMRTStrSetFileName a DICOM-RT Structure set file name - + @param aDICOMRTStrSetFileName a DICOM-RT Structure set file name or a directory name + @exception InvalidParameterException thrown if the file does not exist or the directory has no dicom structure file + @exception DcmrtException thrown if load and read file failed */ DicomFileStructureSetGenerator(DICOMRTFileNameString aDICOMRTStrSetFileName); /*! @brief Destructor */ ~DicomFileStructureSetGenerator(); /*! @brief generate structure set @return return shared pointer of StructureSet @exception DcmrtException Thrown if loadFile and read failed @exception InvalidParameterException throw if the imported header tags are not numerical. */ StructureSetPointer generateStructureSet(); }; } } } #endif diff --git a/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.cpp b/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.cpp index 67235a2..3deef8e 100644 --- a/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.cpp +++ b/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.cpp @@ -1,133 +1,84 @@ // ----------------------------------------------------------------------- // 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) */ #include #include #include #include "boost/filesystem/operations.hpp" #include "boost/filesystem/path.hpp" #include "boost/progress.hpp" #include "rttbDicomHelaxFileDoseAccessorGenerator.h" #include "rttbDicomHelaxDoseAccessor.h" #include "rttbInvalidDoseException.h" #include "rttbDcmrtException.h" #include "rttbIndexOutOfBoundsException.h" #include "rttbInvalidParameterException.h" +#include "rttbDicomFileReaderHelper.h" namespace rttb{ namespace io{ namespace helax{ DicomHelaxFileDoseAccessorGenerator::~DicomHelaxFileDoseAccessorGenerator(){} DicomHelaxFileDoseAccessorGenerator::DicomHelaxFileDoseAccessorGenerator(FileNameType aDICOMRTDoseDirName){ _doseDirName=aDICOMRTDoseDirName; } core::DoseAccessorGeneratorInterface::DoseAccessorPointer DicomHelaxFileDoseAccessorGenerator::generateDoseAccessor() { - boost::filesystem::path path=boost::filesystem::path(_doseDirName); - + rttb::io::dicom::Modality doseModality= {rttb::io::dicom::Modality::RTDOSE}; + std::vector fileVector = rttb::io::dicom::getFileNamesWithSameUID(_doseDirName, doseModality); OFCondition status; - DcmFileFormat fileformat; - std::vector doseVector; - IDType doseUID; - int file_count=0; - if(!boost::filesystem::exists(path) || !boost::filesystem::is_directory(path)){ - throw core::InvalidParameterException("Directory not found!"); - } - else{ - boost::filesystem::directory_iterator end_iter; - bool isFirstDose=true; + for(int i=0; i(); - for(boost::filesystem::directory_iterator dir_itr(path);dir_itr!=end_iter;++dir_itr) + status = fileformat.loadFile(fileVector.at(i).c_str()); + if (!status.good()) { - if(boost::filesystem::is_regular_file(dir_itr->status())) - { - boost::filesystem::path filePath(dir_itr->path().filename().string()); - filePath=boost::filesystem::system_complete(dir_itr->path()); - - - DRTDoseIODPtr dose= boost::make_shared(); - - status = fileformat.loadFile(filePath.string().c_str()); - if (!status.good()) - { - throw core::InvalidDoseException("Error: load dose fileformat.loadFile failed!"); - } + throw core::InvalidDoseException("Error: load dose fileformat.loadFile failed!"); + } - status = dose->read(*fileformat.getDataset()); - if(!status.good()) - { - throw core::InvalidDoseException("Error: read DRTDoseIOD failed!"); - } - - OFString modality; - status = dose->getModality(modality); - if (modality != "RTDOSE") - { - std::cout<<"Error: "<getSeriesInstanceUID(uid); - - if(file_count==1) - { - doseUID=uid.c_str(); - } - - - if(doseUID!=uid.c_str()) - { - std::cout << "There are more than 1 RT dose in the directory. The DoseAccessor returns only the first one! Loaded uid: "<< doseUID<< ";ignored UID: "<< uid <read(*fileformat.getDataset()); + if(!status.good()) + { + throw core::InvalidDoseException("Error: read DRTDoseIOD failed!"); } + doseVector.push_back(dose); } - _doseAccessor=boost::make_shared(doseVector); return _doseAccessor; } } } } diff --git a/testing/io/dicom/CMakeLists.txt b/testing/io/dicom/CMakeLists.txt index 2af345b..ee8a29d 100644 --- a/testing/io/dicom/CMakeLists.txt +++ b/testing/io/dicom/CMakeLists.txt @@ -1,29 +1,36 @@ #----------------------------------------------------------------------------- # Setup the system information test. Write out some basic failsafe # information in case the test doesn't run. #----------------------------------------------------------------------------- SET(DICOMIO_TEST ${EXECUTABLE_OUTPUT_PATH}/rttbDicomIOTests) SET(TEST_DATA_ROOT ${RTTBTesting_SOURCE_DIR}/data) SET(TEMP ${RTTBTesting_BINARY_DIR}/temporary) #----------------------------------------------------------------------------- ADD_TEST(DicomDoseAccessorGeneratorTest ${DICOMIO_TEST} DicomDoseAccessorGeneratorTest "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantFifty.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncrease3D.dcm" ) +ADD_TEST(DicomFileReaderHelperTest ${DICOMIO_TEST} DicomFileReaderHelperTest +"${TEST_DATA_ROOT}/DICOM/Helax/" +"${TEST_DATA_ROOT}/DICOM/Helax/____mm_1_1.2.276.0.28.19.977891832855880720695789165493875543457754809556.dcm" +"${TEST_DATA_ROOT}/DICOM/Helax/____mm__1.2.276.0.28.19.142087956198378746376227895256244905653791675016.dcm" +) + + ADD_TEST(DicomIOTest ${DICOMIO_TEST} DicomIOTest "${TEST_DATA_ROOT}/DICOM/StructureSet/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantFifty.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncrease3D.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/dicompylerTestDose.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/InhomogeneousGrid.dcm" ) ADD_TEST(DicomStructureSetGeneratorTest ${DICOMIO_TEST} DicomStructureSetGeneratorTest "${TEST_DATA_ROOT}/DICOM/StructureSet/RS1.3.6.1.4.1.2452.6.841242143.1311652612.1170940299.4217870819.dcm" ) RTTB_CREATE_TEST_MODULE(rttbDicomIO DEPENDS RTTBDicomIO PACKAGE_DEPENDS Boost Litmus DCMTK) diff --git a/testing/io/dicom/DicomDoseAccessorGeneratorTest.cpp b/testing/io/dicom/DicomDoseAccessorGeneratorTest.cpp index 28bbeec..65c6cb6 100644 --- a/testing/io/dicom/DicomDoseAccessorGeneratorTest.cpp +++ b/testing/io/dicom/DicomDoseAccessorGeneratorTest.cpp @@ -1,114 +1,115 @@ // ----------------------------------------------------------------------- // 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 #include #include #include #include "litCheckMacros.h" #include "rttbBaseType.h" #include "rttbDicomDoseAccessor.h" #include "rttbDicomFileDoseAccessorGenerator.h" #include "rttbDicomIODDoseAccessorGenerator.h" #include "rttbInvalidDoseException.h" #include "rttbDcmrtException.h" +#include "rttbInvalidParameterException.h" namespace rttb { namespace testing { /*!@brief DicomDoseAccessorGeneratorTest - test the generators for dicom data 1) test dicom file generator generateDoseAccessor() 2) test dicom IOD generator generateDoseAccessor() */ int DicomDoseAccessorGeneratorTest(int argc, char* argv[]) { typedef boost::shared_ptr DRTDoseIODPtr; PREPARE_DEFAULT_TEST_REPORTING; //ARGUMENTS: // 1: dose1 file name // 2: dose2 file name // 3: dose3 file name std::string RTDOSE_FILENAME; std::string RTDOSE2_FILENAME; std::string RTDOSE3_FILENAME; if (argc > 1) { RTDOSE_FILENAME = argv[1]; } if (argc > 2) { RTDOSE2_FILENAME = argv[2]; } if (argc > 3) { RTDOSE3_FILENAME = argv[3]; } OFCondition status; DcmFileFormat fileformat; /* test DicomFileDoseAccessorGenerator generateDoseAccessor()*/ CHECK_THROW_EXPLICIT(io::dicom::DicomFileDoseAccessorGenerator("test.test").generateDoseAccessor(), - core::InvalidDoseException); + core::InvalidParameterException); CHECK_NO_THROW(io::dicom::DicomFileDoseAccessorGenerator( RTDOSE_FILENAME.c_str()).generateDoseAccessor()); CHECK_NO_THROW(io::dicom::DicomFileDoseAccessorGenerator( RTDOSE2_FILENAME.c_str()).generateDoseAccessor()); CHECK_NO_THROW(io::dicom::DicomFileDoseAccessorGenerator( RTDOSE3_FILENAME.c_str()).generateDoseAccessor()); /* test DicomIODDoseAccessorGenerator generateDoseAccessor()*/ DRTDoseIODPtr dose = boost::make_shared(); CHECK_THROW_EXPLICIT(io::dicom::DicomIODDoseAccessorGenerator(dose).generateDoseAccessor(), io::dicom::DcmrtException); fileformat.loadFile(RTDOSE_FILENAME.c_str()); dose->read(*fileformat.getDataset()); CHECK_NO_THROW(io::dicom::DicomIODDoseAccessorGenerator(dose).generateDoseAccessor()); RETURN_AND_REPORT_TEST_SUCCESS; } }//testing }//rttb diff --git a/testing/io/dicom/DicomFileReaderHelperTest.cpp b/testing/io/dicom/DicomFileReaderHelperTest.cpp new file mode 100644 index 0000000..ba3c4db --- /dev/null +++ b/testing/io/dicom/DicomFileReaderHelperTest.cpp @@ -0,0 +1,94 @@ +// ----------------------------------------------------------------------- +// 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: 841 $ (last changed revision) +// @date $Date: 2014-11-07 14:39:21 +0100 (Fr, 07 Nov 2014) $ (last change date) +// @author $Author: zhangl $ (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 "rttbDicomFileReaderHelper.h" + + +namespace rttb +{ + + namespace testing + { + + /*!@brief DicomDoseAccessorGeneratorTest - test the generators for dicom data + 1) test getFileNamesWithSameUID() with a directory name + 2) test getFileNames() with a RTDOSE file name and check equal with getFileNamesWithSameUID() + 3) test getFileNames() with a RTSTRUCT file name + */ + + int DicomFileReaderHelperTest(int argc, char* argv[]) + { + typedef boost::shared_ptr DRTDoseIODPtr; + + PREPARE_DEFAULT_TEST_REPORTING; + //ARGUMENTS: + // 1: helax directory name + // 2: dose file name + // 3: structure file name + + std::string RT_DIRNAME; + std::string RTDOSE_FILENAME; + std::string RTStr_FILENAME; + + if (argc > 3) + { + RT_DIRNAME = argv[1]; + RTDOSE_FILENAME = argv[2]; + RTStr_FILENAME = argv[3]; + } + rttb::io::dicom::Modality doseModality= {rttb::io::dicom::Modality::RTDOSE}; + rttb::io::dicom::Modality strModality= {rttb::io::dicom::Modality::RTSTRUCT}; + + //1) test getFileNamesWithSameUID() with a directory name + std::vector fileVector = rttb::io::dicom::getFileNamesWithSameUID(RT_DIRNAME, doseModality); + CHECK_EQUAL(fileVector.size(), 52); + + //2) test getFileNames() with a RTDOSE file name and check equal with getFileNamesWithSameUID() + std::vector fileVector2 = rttb::io::dicom::getFileNames(RTDOSE_FILENAME); + for(int i=0; i #include #include #include "litCheckMacros.h" #include "rttbBaseType.h" #include "rttbDicomFileStructureSetGenerator.h" #include "rttbDicomIODStructureSetGenerator.h" #include "rttbDcmrtException.h" #include "rttbInvalidParameterException.h" namespace rttb { namespace testing { /*!@brief DicomIOTest - test structure set generator for dicom data 1) test dicom file structure set generator 2) test dicom IOD structure set generator */ int DicomStructureSetGeneratorTest(int argc, char* argv[]) { typedef core::StructureSetGeneratorInterface::StructureSetPointer StructureSetPointer; //typedef boost::shared_ptr DRTStrSetIODPtr; typedef io::dicom::DicomIODStructureSetGenerator::DRTStrSetIODPtr DRTStrSetIODPtr; PREPARE_DEFAULT_TEST_REPORTING; //ARGUMENTS: 1: structure file name std::string RTSTRUCT_FILENAME; if (argc > 1) { RTSTRUCT_FILENAME = argv[1]; } /* structure set */ //1) test dicom file structure set generator CHECK_NO_THROW(io::dicom::DicomFileStructureSetGenerator("")); CHECK_NO_THROW(io::dicom::DicomFileStructureSetGenerator("Test.test")); CHECK_THROW_EXPLICIT(io::dicom::DicomFileStructureSetGenerator("Test.test").generateStructureSet(), - io::dicom::DcmrtException); + rttb::core::InvalidParameterException); CHECK_NO_THROW(io::dicom::DicomFileStructureSetGenerator(RTSTRUCT_FILENAME.c_str())); StructureSetPointer rtStructureSet = io::dicom::DicomFileStructureSetGenerator( RTSTRUCT_FILENAME.c_str()).generateStructureSet(); //2) test dicom IOD structure set generator OFCondition status; DcmFileFormat fileformat; boost::shared_ptr drtStrSetIOD = boost::make_shared(); CHECK_NO_THROW(io::dicom::DicomIODStructureSetGenerator generator1(drtStrSetIOD)); CHECK_THROW_EXPLICIT(io::dicom::DicomIODStructureSetGenerator(drtStrSetIOD).generateStructureSet(), core::InvalidParameterException); status = fileformat.loadFile(RTSTRUCT_FILENAME.c_str()); status = drtStrSetIOD->read(*fileformat.getDataset()); CHECK_NO_THROW(io::dicom::DicomIODStructureSetGenerator generator2(drtStrSetIOD)); CHECK_NO_THROW(io::dicom::DicomIODStructureSetGenerator(drtStrSetIOD).generateStructureSet()); StructureSetPointer rtStructureSet2 = io::dicom::DicomIODStructureSetGenerator( drtStrSetIOD).generateStructureSet(); CHECK_EQUAL(rtStructureSet2->getNumberOfStructures(), rtStructureSet->getNumberOfStructures()); RETURN_AND_REPORT_TEST_SUCCESS; } }//testing }//rttb diff --git a/testing/io/dicom/files.cmake b/testing/io/dicom/files.cmake index f0d4be7..f20cf2e 100644 --- a/testing/io/dicom/files.cmake +++ b/testing/io/dicom/files.cmake @@ -1,9 +1,10 @@ SET(CPP_FILES DicomDoseAccessorGeneratorTest.cpp + DicomFileReaderHelperTest.cpp DicomIOTest.cpp DicomStructureSetGeneratorTest.cpp rttbIOTests.cpp ) SET(H_FILES ) diff --git a/testing/io/dicom/rttbIOTests.cpp b/testing/io/dicom/rttbIOTests.cpp index c27b187..311a27e 100644 --- a/testing/io/dicom/rttbIOTests.cpp +++ b/testing/io/dicom/rttbIOTests.cpp @@ -1,61 +1,62 @@ // ----------------------------------------------------------------------- // 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(DicomDoseAccessorGeneratorTest); + LIT_REGISTER_TEST(DicomFileReaderHelperTest); LIT_REGISTER_TEST(DicomIOTest); - LIT_REGISTER_TEST(DicomStructureSetGeneratorTest); + LIT_REGISTER_TEST(DicomStructureSetGeneratorTest); } } } int main(int argc, char* argv[]) { int result = 0; rttb::testing::registerTests(); try { result = lit::multiTestsMain(argc,argv); } catch(...) { result = -1; } return result; } diff --git a/testing/io/helax/CMakeLists.txt b/testing/io/helax/CMakeLists.txt index 586bc14..37592b1 100644 --- a/testing/io/helax/CMakeLists.txt +++ b/testing/io/helax/CMakeLists.txt @@ -1,25 +1,25 @@ #----------------------------------------------------------------------------- # Setup the system information test. Write out some basic failsafe # information in case the test doesn't run. #----------------------------------------------------------------------------- SET(HelaxIO_TEST ${EXECUTABLE_OUTPUT_PATH}/rttbHelaxIOTests) SET(TEST_DATA_ROOT ${RTTBTesting_SOURCE_DIR}/data) SET(TEMP ${RTTBTesting_BINARY_DIR}/temporary) #----------------------------------------------------------------------------- ADD_TEST(DicomHelaxDoseAccessorGeneratorTest ${HelaxIO_TEST} DicomHelaxDoseAccessorGeneratorTest -"${TEST_DATA_ROOT}/DICOM/HelaxDose/" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo.dcm" +"${TEST_DATA_ROOT}/DICOM/Helax/" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantTwo.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/ConstantFifty.dcm" "${TEST_DATA_ROOT}/DICOM/TestDose/LinearIncrease3D.dcm" ) ADD_TEST(DicomHelaxIOTest ${HelaxIO_TEST} DicomHelaxIOTest -"${TEST_DATA_ROOT}/DICOM/HelaxStructureSet/____mm__1.2.276.0.28.19.142087956198378746376227895256244905653791675016.dcm" "${TEST_DATA_ROOT}/DICOM/HelaxDose/" +"${TEST_DATA_ROOT}/DICOM/Helax/" ) RTTB_CREATE_TEST_MODULE(rttbHelaxIO DEPENDS RTTBHelaxIO RTTBDicomIO PACKAGE_DEPENDS BoostBinaries Litmus DCMTK) diff --git a/testing/io/helax/DicomHelaxIOTest.cpp b/testing/io/helax/DicomHelaxIOTest.cpp index 54e5ead..62d4b3b 100644 --- a/testing/io/helax/DicomHelaxIOTest.cpp +++ b/testing/io/helax/DicomHelaxIOTest.cpp @@ -1,136 +1,128 @@ // ----------------------------------------------------------------------- // 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 #include #include #include #include "litCheckMacros.h" #include "rttbBaseType.h" #include "rttbGeometricInfo.h" #include "rttbDoseIteratorInterface.h" #include "rttbDicomHelaxFileDoseAccessorGenerator.h" #include "rttbDicomHelaxIODVecDoseAccessorGenerator.h" #include "rttbDicomHelaxDoseAccessor.h" #include "rttbDicomFileStructureSetGenerator.h" namespace rttb { namespace testing { /*!@brief DicomHelaxIOTest - test the IO for dicom helax data 1) test dicom helax dose import if geometric info was set correctly 2) test dicom helax dose import accessing dose data and converting 3) test dicom helax structure import WARNING: The values for comparison need to be adjusted if the input files are changed! */ int DicomHelaxIOTest(int argc, char* argv[]) { typedef core::DoseIteratorInterface::DoseAccessorPointer DoseAccessorPointer; typedef core::StructureSetGeneratorInterface::StructureSetPointer StructureSetPointer; PREPARE_DEFAULT_TEST_REPORTING; - //ARGUMENTS: 1: structure file name - // 2: dose1 directory name + //ARGUMENTS: 1: directory name - - std::string RTSTRUCT_FILENAME; - std::string RTDOSE_DIRNAME; + std::string RT_DIRNAME; if (argc > 1) { - RTSTRUCT_FILENAME = argv[1]; - } - - if (argc > 2) - { - RTDOSE_DIRNAME = argv[2]; + RT_DIRNAME = argv[1]; } OFCondition status; DcmFileFormat fileformat; /* read dicom-rt dose */ - io::helax::DicomHelaxFileDoseAccessorGenerator doseAccessorGenerator1(RTDOSE_DIRNAME.c_str()); + io::helax::DicomHelaxFileDoseAccessorGenerator doseAccessorGenerator1(RT_DIRNAME.c_str()); DoseAccessorPointer doseAccessor1(doseAccessorGenerator1.generateDoseAccessor()); //1) test dicom dose import if geometric info was set correctly core::GeometricInfo geoInfo = doseAccessor1->getGeometricInfo(); CHECK_EQUAL(64, geoInfo.getNumRows()); CHECK_EQUAL(54, geoInfo.getNumColumns()); CHECK_EQUAL(52, geoInfo.getNumSlices()); CHECK_EQUAL(OrientationMatrix(), geoInfo.getOrientationMatrix()); const VoxelGridID start = 0; const VoxelGridIndex3D start3D(0); VoxelGridID end, inbetween; VoxelGridIndex3D end3D, inbetween3D; //2) test dicom dose import accessing dose data and converting CHECK_EQUAL(doseAccessor1->getDoseAt(start), doseAccessor1-> getDoseAt(start3D)); inbetween = int(std::floor(doseAccessor1->getGridSize() / 2.0)); doseAccessor1->getGeometricInfo().convert(inbetween, inbetween3D); CHECK_EQUAL(doseAccessor1->getDoseAt(inbetween), doseAccessor1-> getDoseAt(inbetween3D)); end = doseAccessor1->getGridSize() - 1; doseAccessor1->getGeometricInfo().convert(end, end3D); CHECK_EQUAL(doseAccessor1->getDoseAt(end), doseAccessor1-> getDoseAt(end3D)); /* structure set */ StructureSetPointer rtStructureSet = io::dicom::DicomFileStructureSetGenerator( - RTSTRUCT_FILENAME.c_str()).generateStructureSet(); + RT_DIRNAME.c_str()).generateStructureSet(); //3) test structure import CHECK_EQUAL(8, rtStructureSet->getNumberOfStructures()); CHECK_EQUAL("Patient outline", (rtStructureSet->getStructure(0))->getLabel()); CHECK_EQUAL("boost", (rtStructureSet->getStructure(1))->getLabel()); CHECK_EQUAL("Chiasma", (rtStructureSet->getStructure(2))->getLabel()); CHECK_EQUAL("Sehnerv li.", (rtStructureSet->getStructure(3))->getLabel()); CHECK_EQUAL("Sehnerv re.", (rtStructureSet->getStructure(4))->getLabel()); CHECK_EQUAL("Auge li.", (rtStructureSet->getStructure(5))->getLabel()); CHECK_EQUAL("Auge re.", (rtStructureSet->getStructure(6))->getLabel()); CHECK_EQUAL("Hirnstamm", (rtStructureSet->getStructure(7))->getLabel()); RETURN_AND_REPORT_TEST_SUCCESS; } }//testing }//rttb