diff --git a/code/algorithms/rttbDoseStatisticsCalculator.h b/code/algorithms/rttbDoseStatisticsCalculator.h index 3f075be..d88fb09 100644 --- a/code/algorithms/rttbDoseStatisticsCalculator.h +++ b/code/algorithms/rttbDoseStatisticsCalculator.h @@ -1,201 +1,201 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DOSE_STATISTICS_CALCULATOR_H #define __DOSE_STATISTICS_CALCULATOR_H #include #include #include #include "rttbDoseIteratorInterface.h" #include "rttbDoseStatistics.h" #include "RTTBAlgorithmsExports.h" #include "rttbDxVolumeToDoseMeasureCollectionCalculator.h" #include "rttbVxDoseToVolumeMeasureCollectionCalculator.h" #include "rttbMOHxVolumeToDoseMeasureCollectionCalculator.h" #include "rttbMOCxVolumeToDoseMeasureCollectionCalculator.h" #include "rttbMaxOHxVolumeToDoseMeasureCollectionCalculator.h" #include "rttbMinOCxVolumeToDoseMeasureCollectionCalculator.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace algorithms { /*! @class DoseStatisticsCalculator @brief Class for calculating different statistical values from a RT dose distribution @details These values range from standard statistical values such as minimum, maximum and mean to more complex dose specific measures such as Vx (volume irradiated with a dose >=x), Dx (minimal dose delivered to x% of the VOI) or MOHx (mean in the hottest volume). For a complete list, see calculateDoseStatistics(). @note the complex dose statistics are precomputed and cannot be computed "on the fly" lateron! The doses/volumes that should be used for precomputation have to be set in calculateDoseStatistics() */ class RTTBAlgorithms_EXPORT DoseStatisticsCalculator { public: using DoseIteratorPointer = core::DoseIteratorInterface::Pointer; using ResultListPointer = DoseStatistics::ResultListPointer; using DoseStatisticsPointer = DoseStatistics::Pointer; private: DoseIteratorPointer _doseIterator; /*! @brief Contains relevant dose values sorted in descending order. */ std::vector _doseVector; /*! @brief Contains the corresponding voxel proportions to the values in doseVector. */ std::vector _voxelProportionVector; /*! @brief The doseStatistics are stored here. */ DoseStatisticsPointer _statistics; bool _simpleDoseStatisticsCalculated; bool _complexDoseStatisticsCalculated; bool _multiThreading; ::boost::shared_ptr _mutex; VxDoseToVolumeMeasureCollectionCalculator::Pointer _Vx; DxVolumeToDoseMeasureCollectionCalculator::Pointer _Dx; MOHxVolumeToDoseMeasureCollectionCalculator::Pointer _MOHx; MOCxVolumeToDoseMeasureCollectionCalculator::Pointer _MOCx; MaxOHxVolumeToDoseMeasureCollectionCalculator::Pointer _MaxOHx; MinOCxVolumeToDoseMeasureCollectionCalculator::Pointer _MinOCx; /*! @brief Calculates the positions where the dose has its maximum @param maxNumberMaximaPositions the maximal amount of computed positions @pre maximumDose must be defined in _statistics with the correct value */ ResultListPointer computeMaximumPositions(unsigned int maxNumberMaximaPositions) const; /*! @brief Calculates the positions where the dose has its minimum @param maxNumberMinimaPositions the maximal amount of computed positions (they are read sequentially using the iterator until maxNumberMinimaPositions have been read, other positions are not considered) @pre minimumDose must be defined in _statistics with the correct value */ ResultListPointer computeMinimumPositions(unsigned int maxNumberMinimaPositions) const; /*! @brief Calculates simple dose statistics (min, mean, max, stdDev, minDosePositions, maxDosePositions) @param maxNumberMinimaPositions the maximal amount of computed positions where the dose has its minimum that is computed @param maxNumberMaximaPositions the maximal amount of computed positions where the dose has its maximum that is computed */ void calculateSimpleDoseStatistics(unsigned int maxNumberMinimaPositions, unsigned int maxNumberMaximaPositions); /*! @brief Calculates complex dose statistics (Dx, Vx, MOHx, MOCx, MaxOHx, MinOCx) @warning computations can take quite long (>1 min) for large structures as many statistics are precomputed */ void calculateComplexDoseStatistics(DoseTypeGy referenceDose, const std::vector& precomputeDoseValues, const std::vector& precomputeVolumeValues); public: ~DoseStatisticsCalculator(); /*! @brief Constructor @param aDoseIterator the dose to be analyzed */ - DoseStatisticsCalculator(DoseIteratorPointer aDoseIterator); + explicit DoseStatisticsCalculator(DoseIteratorPointer aDoseIterator); DoseIteratorPointer getDoseIterator() const; /*! @brief Compute simple or complex dose statistics with default relative x values and the maximum dose as default reference dose (for Vx computation) @details The following statistics are calculated always (i.e. also if computeComplexMeasures=false):
  • minimum dose
  • mean dose
  • maximum dose
  • standard deviation dose
  • voxel positions of minimum dose
  • voxel positions of maximum dose
Additionally, these statistics are computed if computeComplexMeasures=true:
  • Dx (the minimal dose delivered to a volume >= x)
  • Vx (the volume irradiated with a dose >= x)
  • MOHx (mean dose of the hottest x volume)
  • MOCx (mean dose of the coldest x volume)
  • MaxOHx (Maximum outside of the hottest x volume)
  • MinOCx (Minimum outside of the coldest x volume)
Default x values for Vx are 0.02, 0.05, 0.1, 0.9, 0.95 and 0.98, with respect to maxDose. Default x values for Dx, MOHx, MOCx, MaxOHx and MinOCx are 0.02, 0.05, 0.1, 0.9, 0.95 and 0.98, with respect to volume. @param computeComplexMeasures should complex statistics be calculated? If it is true, the complex dose statistics will be calculated with default relative x values and the maximum dose as reference dose @param maxNumberMinimaPositions the maximal amount of computed positions where the dose has its minimum that is computed @param maxNumberMaximaPositions the maximal amount of computed positions where the dose has its maximum that is computed @warning If computeComplexMeasures==true, computations can take quite long (>1 min) for large structures as many statistics are precomputed @note The complex dose statistics are precomputed and cannot be computed "on the fly" lateron! Only the default x values can be requested in DoseStatistics! */ DoseStatisticsPointer calculateDoseStatistics(bool computeComplexMeasures = false, unsigned int maxNumberMinimaPositions = 10, unsigned int maxNumberMaximaPositions = 10); /*! @brief Compute complex dose statistics with given reference dose and default relative x values @param referenceDose the reference dose to compute Vx, normally it should be the prescribed dose @param maxNumberMinimaPositions the maximal amount of computed positions where the dose has its minimum that is computed @param maxNumberMaximaPositions the maximal amount of computed positions where the dose has its maximum that is computed @exception InvalidParameterException thrown if referenceDose <= 0 @warning Computations can take quite long (>1 min) for large structures as many statistics are precomputed @note The complex dose statistics are precomputed and cannot be computed "on the fly" lateron! Only the default x values can be requested in DoseStatistics! */ DoseStatisticsPointer calculateDoseStatistics(DoseTypeGy referenceDose, unsigned int maxNumberMinimaPositions = 10, unsigned int maxNumberMaximaPositions = 10); /*! @brief Compute complex dose statistics with given relative x values and reference dose @param precomputeDoseValues the relative dose values for Vx precomputation, e.g. 0.02, 0.05, 0.95... @param precomputeVolumeValues the relative volume values for Dx, MOHx, MOCx, MaxOHx and MinOCx precomputation, e.g. 0.02, 0.05, 0.95... @param referenceDose the reference dose to compute Vx, normally it should be the prescribed dose. Default value is the maximum dose. @param maxNumberMinimaPositions the maximal amount of computed positions where the dose has its minimum that is computed @param maxNumberMaximaPositions the maximal amount of computed positions where the dose has its maximum that is computed @warning Computations can take quite long (>1 min) for large structures as many statistics are precomputed @note The complex dose statistics are precomputed and cannot be computed "on the fly" lateron! The doses/volumes that should be used for precomputation have to be set by in precomputeDoseValues and precomputeVolumeValues. Only these values can be requested in DoseStatistics! */ DoseStatisticsPointer calculateDoseStatistics(const std::vector& precomputeDoseValues, const std::vector& precomputeVolumeValues, DoseTypeGy referenceDose = -1, unsigned int maxNumberMinimaPositions = 10, unsigned int maxNumberMaximaPositions = 10); /*! @brief Adds additonal precompute values for all complex Dose Statistics @exception InvalidDoseException if complexDoseStatistics are not already calculated */ void addPrecomputeValues(const std::vector& values); /*! @brief Recalculates the DoseMeasures for all complex Dose Statistics @exception InvalidDoseException if complexDoseStatistics are not already calculated */ void recalculateDoseStatistics(); void setMultiThreading(bool choice); }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/core/rttbBaseType.h b/code/core/rttbBaseType.h index d6d53d8..34d2fe6 100644 --- a/code/core/rttbBaseType.h +++ b/code/core/rttbBaseType.h @@ -1,613 +1,613 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __BASE_TYPE_NEW_H #define __BASE_TYPE_NEW_H #include #include #include #include #include #include #include #include #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { const double errorConstant = 1e-5; const double reducedErrorConstant = 0.0001; using UnsignedIndex1D = unsigned short; /*! @class UnsignedIndex3D @brief 3D index. */ class UnsignedIndex3D: public boost::numeric::ublas::vector { public: UnsignedIndex3D() : boost::numeric::ublas::vector(3,0) {} - UnsignedIndex3D(const UnsignedIndex1D value) : boost::numeric::ublas::vector(3, + explicit UnsignedIndex3D(const UnsignedIndex1D value) : boost::numeric::ublas::vector(3, value) {} UnsignedIndex3D(const UnsignedIndex1D xValue, const UnsignedIndex1D yValue, const UnsignedIndex1D zValue) : boost::numeric::ublas::vector(3, xValue) { (*this)(1) = yValue; (*this)(2) = zValue; } const UnsignedIndex1D x() const { return (*this)(0); } const UnsignedIndex1D y() const { return (*this)(1); } const UnsignedIndex1D z() const { return (*this)(2); } friend bool operator==(const UnsignedIndex3D& gi1, const UnsignedIndex3D& gi2) { if (gi1.size() != gi2.size()) { return false; } for (size_t i = 0; i < gi1.size(); i++) { if (gi1(i) != gi2(i)) { return false; } } return true; } friend std::ostream& operator<<(std::ostream& s, const UnsignedIndex3D& aVector) { s << "[ " << aVector(0) << ", " << aVector(1) << ", " << aVector(2) << " ]"; return s; } }; using UnsignedIndexList = std::list; using FileNameString = std::string; using ContourGeometricTypeString = std::string; using WorldCoordinate = double; /*! @class WorldCoordinate3D @brief 3D coordinate in real world coordinates like in DICOM to define ImagePositionPatient. */ class WorldCoordinate3D: public boost::numeric::ublas::vector { public: WorldCoordinate3D() : boost::numeric::ublas::vector(3,0) {} - WorldCoordinate3D(const WorldCoordinate value) : boost::numeric::ublas::vector(3, + explicit WorldCoordinate3D(const WorldCoordinate value) : boost::numeric::ublas::vector(3, value) {} WorldCoordinate3D(const WorldCoordinate xValue, const WorldCoordinate yValue, const WorldCoordinate zValue) : boost::numeric::ublas::vector(3, xValue) { (*this)(1) = yValue; (*this)(2) = zValue; } WorldCoordinate3D(const WorldCoordinate3D& w): boost::numeric::ublas::vector(3) { (*this)(0) = w.x(); (*this)(1) = w.y(); (*this)(2) = w.z(); } const WorldCoordinate x() const { return (*this)(0); } const WorldCoordinate y() const { return (*this)(1); } const WorldCoordinate z() const { return (*this)(2); } //vector cross product (not included in boost.ublas) WorldCoordinate3D cross(WorldCoordinate3D aVector) const { WorldCoordinate3D result; WorldCoordinate x = (*this)(0); WorldCoordinate y = (*this)(1); WorldCoordinate z = (*this)(2); result(0) = y * aVector(2) - z * aVector(1); result(1) = z * aVector(0) - x * aVector(2); result(2) = x * aVector(1) - y * aVector(0); return result; } const std::string toString() const { std::string s = std::to_string(x()) + " " + std::to_string(y()) + " " + std::to_string(z()); return s; } WorldCoordinate3D& operator=(const WorldCoordinate3D& wc) { (*this)(0) = wc.x(); (*this)(1) = wc.y(); (*this)(2) = wc.z(); return (*this); } WorldCoordinate3D& operator=(const boost::numeric::ublas::vector wc) { (*this)(0) = wc(0); (*this)(1) = wc(1); (*this)(2) = wc(2); return (*this); } WorldCoordinate3D operator-(const boost::numeric::ublas::vector wc) { return WorldCoordinate3D((*this)(0) - wc(0), (*this)(1) - wc(1), (*this)(2) - wc(2)); } WorldCoordinate3D operator+(const boost::numeric::ublas::vector wc) { return WorldCoordinate3D((*this)(0) + wc(0), (*this)(1) + wc(1), (*this)(2) + wc(2)); } friend bool operator==(const WorldCoordinate3D& wc1, const WorldCoordinate3D& wc2) { if (wc1.size() != wc2.size()) { return false; } for (size_t i = 0; i < wc1.size(); i++) { if (wc1(i) != wc2(i)) { return false; } } return true; } bool equalsAlmost(const WorldCoordinate3D& another, double errorConstantWC = 1e-5) const { if (size() != another.size()) { return false; } double dist = norm_2(*this - another); return dist < errorConstantWC; } friend std::ostream& operator<<(std::ostream& s, const WorldCoordinate3D& aVector) { s << "[ " << aVector(0) << ", " << aVector(1) << ", " << aVector(2) << " ]"; return s; } }; /* ! @brief continuous index */ using DoubleVoxelGridIndex3D = rttb::WorldCoordinate3D; using ImageSize = rttb::UnsignedIndex3D; using GridVolumeType = double; /*! @class SpacingVectorType3D @brief 3D spacing vector. @pre values of this vector may not be negative. */ class SpacingVectorType3D: public boost::numeric::ublas::vector { public: SpacingVectorType3D() : boost::numeric::ublas::vector(3,0) {} - SpacingVectorType3D(const GridVolumeType value) : boost::numeric::ublas::vector(3, + explicit SpacingVectorType3D(const GridVolumeType value) : boost::numeric::ublas::vector(3, value) { if (value < 0) { throw std::invalid_argument("received negative value"); } } SpacingVectorType3D(const GridVolumeType xValue, const GridVolumeType yValue, const GridVolumeType zValue) : boost::numeric::ublas::vector(3) { if (xValue < 0 || yValue < 0 || zValue < 0) { throw std::invalid_argument("received negative value"); } (*this)(0) = xValue; (*this)(1) = yValue; (*this)(2) = zValue; } SpacingVectorType3D(const SpacingVectorType3D& w) : SpacingVectorType3D(w.x(), w.y(), w.z()) { } const GridVolumeType x() const { return (*this)(0); } const GridVolumeType y() const { return (*this)(1); } const GridVolumeType z() const { return (*this)(2); } const std::string toString() const { std::string s = std::to_string(x()) + " " + std::to_string(y()) + " " + std::to_string(z()); return s; } SpacingVectorType3D& operator=(const SpacingVectorType3D& wc) { (*this)(0) = wc.x(); (*this)(1) = wc.y(); (*this)(2) = wc.z(); return (*this); } SpacingVectorType3D& operator=(const WorldCoordinate3D& wc) { (*this)(0) = GridVolumeType(wc.x()); (*this)(1) = GridVolumeType(wc.y()); (*this)(2) = GridVolumeType(wc.z()); return (*this); } SpacingVectorType3D& operator=(const boost::numeric::ublas::vector wc) { (*this)(0) = wc(0); (*this)(1) = wc(1); (*this)(2) = wc(2); return (*this); } friend bool operator==(const SpacingVectorType3D& wc1, const SpacingVectorType3D& wc2) { if (wc1.size() != wc2.size()) { return false; } for (size_t i = 0; i < wc1.size(); i++) { if (wc1(i) != wc2(i)) { return false; } } return true; } bool equalsAlmost(const SpacingVectorType3D& another, double errorConstantSV = 1e-5) const { if ((*this).size() != another.size()) { return false; } double dist = norm_2(*this - another); return dist < errorConstantSV; } friend std::ostream& operator<<(std::ostream& s, const SpacingVectorType3D& aVector) { s << "[ " << aVector(0) << ", " << aVector(1) << ", " << aVector(2) << " ]"; return s; } }; /*! @class OrientationMatrix @brief Used to store image orientation information */ class OrientationMatrix : public boost::numeric::ublas::matrix { public: /*! The default constructor generates a 3x3 unit matrix */ OrientationMatrix() : boost::numeric::ublas::matrix(3, 3, 0) { for (std::size_t m = 0; m < (*this).size1(); m++) { (*this)(m, m) = 1; } } - OrientationMatrix(const WorldCoordinate value) : boost::numeric::ublas::matrix(3, + explicit OrientationMatrix(const WorldCoordinate value) : boost::numeric::ublas::matrix(3, 3, value) {} bool equalsAlmost(const OrientationMatrix& anOrientationMatrix, double errorConstantOM=1e-5) const { if (anOrientationMatrix.size1() == (*this).size1()) { if (anOrientationMatrix.size2() == (*this).size2()) { for (std::size_t m = 0; m < anOrientationMatrix.size1(); m++) { for (std::size_t n = 0; n < anOrientationMatrix.size2(); n++) { if ((std::abs((*this)(m, n) - anOrientationMatrix(m, n)) > errorConstantOM)) { return false; } } }// end element comparison } else { return false; } } else { return false; } return true; } friend bool operator==(const OrientationMatrix& om1, const OrientationMatrix& om2) { return om1.equalsAlmost(om2, 0.0); } friend std::ostream& operator<<(std::ostream& s, const OrientationMatrix& anOrientationMatrix) { s << "[ "; for (std::size_t m = 0; m < anOrientationMatrix.size1(); m++) { s << "[ "; for (std::size_t n = 0; n < anOrientationMatrix.size2(); n++) { if (n == 0) { s << anOrientationMatrix(m, n); } else { s << ", " << anOrientationMatrix(m, n); } } s << " ]"; } s << " ]"; return s; } }; /*! base for 2D and 3D VoxelIndex; Therefore required beside VoxelGridID */ using GridIndexType = unsigned int; /*! @class VoxelGridIndex3D @brief 3D voxel grid index in a discret geometry (matrix/image). @details analogous to DICOM where ImagePositionPatient gives the position of the center of the first coordinate (0/0/0) */ class VoxelGridIndex3D: public boost::numeric::ublas::vector { public: VoxelGridIndex3D() : boost::numeric::ublas::vector(3,0) {} - VoxelGridIndex3D(const GridIndexType value) : boost::numeric::ublas::vector(3, + explicit VoxelGridIndex3D(const GridIndexType value) : boost::numeric::ublas::vector(3, value) {} VoxelGridIndex3D(const GridIndexType xValue, const GridIndexType yValue, const GridIndexType zValue) : boost::numeric::ublas::vector(3, xValue) { (*this)(1) = yValue; (*this)(2) = zValue; } const GridIndexType x() const { return (*this)(0); } const GridIndexType y() const { return (*this)(1); } const GridIndexType z() const { return (*this)(2); } const std::string toString() const { std::string s = std::to_string(x()) + " " + std::to_string(y()) + " " + std::to_string(z()); return s; } VoxelGridIndex3D& operator=(const UnsignedIndex3D& ui) { (*this)(0) = ui(0); (*this)(1) = ui(1); (*this)(2) = ui(2); return (*this); } friend bool operator==(const VoxelGridIndex3D& gi1, const VoxelGridIndex3D& gi2) { if (gi1.size() != gi2.size()) { return false; } for (size_t i = 0; i < gi1.size(); i++) { if (gi1(i) != gi2(i)) { return false; } } return true; } friend std::ostream& operator<<(std::ostream& s, const VoxelGridIndex3D& aVector) { s << "[ " << aVector(0) << ", " << aVector(1) << ", " << aVector(2) << " ]"; return s; } }; /*! @class VoxelGridIndex3D @brief 2D voxel grid index. */ class VoxelGridIndex2D: public boost::numeric::ublas::vector { public: VoxelGridIndex2D() : boost::numeric::ublas::vector(2,0) {} - VoxelGridIndex2D(const GridIndexType value) : boost::numeric::ublas::vector(2, + explicit VoxelGridIndex2D(const GridIndexType value) : boost::numeric::ublas::vector(2, value) {} VoxelGridIndex2D(const GridIndexType xValue, const GridIndexType yValue) : boost::numeric::ublas::vector(2, xValue) { (*this)(1) = yValue; } const GridIndexType x() const { return (*this)(0); } const GridIndexType y() const { return (*this)(1); } const std::string toString() const { std::string s = std::to_string(x()) + " " + std::to_string(y()); return s; } friend bool operator==(const VoxelGridIndex2D& gi1, const VoxelGridIndex2D& gi2) { if (gi1.size() != gi2.size()) { return false; } for (size_t i = 0; i < gi1.size(); i++) { if (gi1(i) != gi2(i)) { return false; } } return true; } friend std::ostream& operator<<(std::ostream& s, const VoxelGridIndex2D& aVector) { s << "[ " << aVector(0) << ", " << aVector(1) << " ]"; return s; } }; using GridSizeType = long; using VoxelGridID = int; //starts from 0 and is continuously counting all positions on the grid using VoxelGridDimensionType = unsigned int; typedef double FractionType, DVHVoxelNumber; typedef double DoseCalcType, DoseTypeGy, GenericValueType, DoseVoxelVolumeType, VolumeType, GridVolumeType, PercentType, VoxelNumberType, BEDType, LQEDType; using IDType = std::string; using StructureLabel = std::string; struct DVHRole { enum Type { TargetVolume = 1, HealthyTissue = 2, WholeVolume = 4, UserDefined = 128 } Type; }; struct DVHType { enum Type { Differential = 1, Cumulative = 2 } Type; }; using FileNameType = std::string; using PolygonType = std::vector; using PolygonSequenceType = std::vector; using IndexValueType = double; using DoseStatisticType = double; using DICOMRTFileNameString = std::string; using Uint16 = unsigned short; typedef std::string XMLString, StatisticsString; }//end: namespace rttb #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/core/rttbDataNotAvailableException.h b/code/core/rttbDataNotAvailableException.h index ebe6bf4..5648cb1 100644 --- a/code/core/rttbDataNotAvailableException.h +++ b/code/core/rttbDataNotAvailableException.h @@ -1,42 +1,42 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DATA_NOT_AVAILABLE_EXCEPTION_H #define __DATA_NOT_AVAILABLE_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class DataNotAvailableException @brief This exception will be thrown if the requested data is not available. */ class RTTBCore_EXPORT DataNotAvailableException : public Exception { public: - DataNotAvailableException(const std::string& aWhat) : Exception(aWhat) {} + explicit DataNotAvailableException(const std::string& aWhat) : Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbDoseIteratorInterface.h b/code/core/rttbDoseIteratorInterface.h index 4fe6915..476a0aa 100644 --- a/code/core/rttbDoseIteratorInterface.h +++ b/code/core/rttbDoseIteratorInterface.h @@ -1,100 +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. // //------------------------------------------------------------------------ #ifndef __DOSE_ITERATOR_INTERFACE_NEW_H #define __DOSE_ITERATOR_INTERFACE_NEW_H #include "rttbBaseType.h" #include "rttbCommon.h" #include "rttbDoseAccessorInterface.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace core { class GeometricInfo; /*! @class DoseIteratorInterface @brief This class represents the dose iterator interface. */ class DoseIteratorInterface { public: rttbClassMacroNoParent(DoseIteratorInterface); using DoseAccessorPointer = DoseAccessorInterface::Pointer; private: DoseIteratorInterface(const DoseIteratorInterface&) = delete; //not implemented on purpose -> non-copyable DoseIteratorInterface& operator=(const DoseIteratorInterface&) = delete;//not implemented on purpose -> non-copyable DoseIteratorInterface() = default; protected: /*! @brief DoseAccessor to get access to actual dose data */ DoseAccessorPointer _spDoseAccessor; public: /*! @brief Constructor with a DoseIterator this should be the default for all implementations. */ - DoseIteratorInterface(DoseAccessorPointer aDoseAccessor); + explicit DoseIteratorInterface(DoseAccessorPointer aDoseAccessor); virtual ~DoseIteratorInterface() = default; /*! @brief Set the iterator to the start of the dose. */ virtual bool reset() = 0; /*! @brief Move to next position. If this position is valid is not necessarily tested. */ virtual void next() = 0; virtual bool isPositionValid() const = 0; /*! @brief Return volume of one voxel (in cm3)*/ //previously getDeltaV() virtual DoseVoxelVolumeType getCurrentVoxelVolume() const = 0; virtual DoseTypeGy getCurrentDoseValue() const = 0; /*! @return If this is a masked dose iterator, return the voxel proportion inside a given structure, value 0~1; Otherwise, 1 */ virtual FractionType getCurrentRelevantVolumeFraction() const = 0; virtual VoxelGridID getCurrentVoxelGridID() const = 0; virtual IDType getVoxelizationID() const { return ""; }; IDType getDoseUID() const { return _spDoseAccessor->getUID(); }; }; //end class }//end: namespace core }//end: namespace rttb #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/core/rttbException.h b/code/core/rttbException.h index bf6b25b..92f99d7 100644 --- a/code/core/rttbException.h +++ b/code/core/rttbException.h @@ -1,44 +1,44 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __RTTBEXCEPTION_H #define __RTTBEXCEPTION_H #include #include #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class Exception @brief Exception interface used by all RTToolbox exceptions. */ class RTTBCore_EXPORT Exception : public std::runtime_error { public: - Exception(const std::string& aWhat) + explicit Exception(const std::string& aWhat) : runtime_error(aWhat) {}; }; } } #endif diff --git a/code/core/rttbGenericDoseIterator.h b/code/core/rttbGenericDoseIterator.h index 4c5a53d..32eb957 100644 --- a/code/core/rttbGenericDoseIterator.h +++ b/code/core/rttbGenericDoseIterator.h @@ -1,106 +1,106 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __GENERIC_DOSE_ITERATOR_INTERFACE_NEW_H #define __GENERIC_DOSE_ITERATOR_INTERFACE_NEW_H #include #include #include #include "rttbBaseType.h" #include "rttbDoseIteratorInterface.h" #include "RTTBCoreExports.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace core { /*! @class GenericDoseIterator @brief Standard implementation of the dose iterator interface. */ class RTTBCore_EXPORT GenericDoseIterator : public DoseIteratorInterface { public: using DoseAccessorPointer = DoseAccessorInterface::Pointer; using DoseIteratorPointer = DoseIteratorInterface::Pointer; private: VoxelGridID _currentDoseVoxelGridID; DoseVoxelVolumeType _currentVoxelVolume; GenericDoseIterator(const GenericDoseIterator&) = delete; //not implemented on purpose -> non-copyable GenericDoseIterator& operator=(const GenericDoseIterator&) = delete;//not implemented on purpose -> non-copyable public: /*! @brief Constructor @param aDoseAccessor contains the corresponding dose data */ - GenericDoseIterator(DoseAccessorPointer aDoseAccessor); + explicit GenericDoseIterator(DoseAccessorPointer aDoseAccessor); /*! @brief Set the itterator to the start of the Dose. @exception InvalidParameterException if a inhomogeneous grid is defined in the dose accessors, because these grids are currently not supported. */ bool reset() override; /*! @brief Test if next voxel position is still on the data grid, if so move to next position. */ void next() override; /*! @brief Determine if the current voxel position is valid. */ bool isPositionValid() const override; /*! @brief Return volume of one voxel (in cm3) @exception InvalidParameterException if a inhomogeneous grid is defined in the dose accessors, because these grids are currently not supported. */ DoseVoxelVolumeType getCurrentVoxelVolume() const override; DoseTypeGy getCurrentDoseValue() const override; /*! @brief For DoseIterators this function returns 1, always, because no mask is applied. */ inline FractionType getCurrentRelevantVolumeFraction() const override { return 1; }; inline VoxelGridID getCurrentVoxelGridID() const override { return _currentDoseVoxelGridID; }; }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/core/rttbIndexOutOfBoundsException.h b/code/core/rttbIndexOutOfBoundsException.h index c645f2f..39f9732 100644 --- a/code/core/rttbIndexOutOfBoundsException.h +++ b/code/core/rttbIndexOutOfBoundsException.h @@ -1,41 +1,41 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __INDEX_OUT_OF_BOUNDS_EXCEPTION_H #define __INDEX_OUT_OF_BOUNDS_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class IndexOutOfBoundsException @brief This exception will be thrown if any index out of bound. */ class RTTBCore_EXPORT IndexOutOfBoundsException : public Exception { public: - IndexOutOfBoundsException(const std::string& aWhat): Exception(aWhat) {} + explicit IndexOutOfBoundsException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbInvalidDoseException.h b/code/core/rttbInvalidDoseException.h index c815749..720a70a 100644 --- a/code/core/rttbInvalidDoseException.h +++ b/code/core/rttbInvalidDoseException.h @@ -1,42 +1,42 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __INVALID_DOSE_EXCEPTION_H #define __INVALID_DOSE_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class InvalidDoseException @brief This exception will be thrown if dose is invalid. */ class RTTBCore_EXPORT InvalidDoseException : public Exception { public: - InvalidDoseException(const std::string& aWhat): Exception(aWhat) {} + explicit InvalidDoseException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbInvalidParameterException.h b/code/core/rttbInvalidParameterException.h index 1d4d903..7c90796 100644 --- a/code/core/rttbInvalidParameterException.h +++ b/code/core/rttbInvalidParameterException.h @@ -1,41 +1,41 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __INVALID_PARAMETER_EXCEPTION_H #define __INVALID_PARAMETER_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class InvalidParameterException @brief This exception will be thrown if any parameter is invalid. */ class RTTBCore_EXPORT InvalidParameterException : public Exception { public: - InvalidParameterException(const std::string& aWhat): Exception(aWhat) {} + explicit InvalidParameterException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbMappingOutsideOfImageException.h b/code/core/rttbMappingOutsideOfImageException.h index 7f97af1..93c368e 100644 --- a/code/core/rttbMappingOutsideOfImageException.h +++ b/code/core/rttbMappingOutsideOfImageException.h @@ -1,42 +1,42 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __MAPPING_OUTSIDE_OF_IMAGE_EXCEPTION_H #define __MAPPING_OUTSIDE_OF_IMAGE_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class MappingOutsideOfImageException @brief This exception will be thrown if a transformation leads to an invalid position outside of the image. */ class RTTBCore_EXPORT MappingOutsideOfImageException : public Exception { public: - MappingOutsideOfImageException(const std::string& aWhat): Exception(aWhat) {} + explicit MappingOutsideOfImageException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbMaskVoxel.h b/code/core/rttbMaskVoxel.h index 1f7891d..a641433 100644 --- a/code/core/rttbMaskVoxel.h +++ b/code/core/rttbMaskVoxel.h @@ -1,86 +1,86 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __MASK_VOXEL_NEW_H #define __MASK_VOXEL_NEW_H #include "rttbBaseType.h" #include "RTTBCoreExports.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace core { /*! @class MaskVoxel * @brief AMaskVoxel stores the VoxelGridID of the corresponding dose voxel and the corresponding volume fraction as defined by the given mask. */ class RTTBCore_EXPORT MaskVoxel { private: /*! @brief A 1D voxel grid index on dose grid */ VoxelGridID _voxelGridID; /*! @brief The relevant volume fraction that is masked by the given structure: 0~1 */ FractionType _volumeFraction; public: /*! @brief Constructor @pre aVoxelGridID needs to point to a valid grid position. */ - MaskVoxel(const VoxelGridID& aVoxelGridID); + explicit MaskVoxel(const VoxelGridID& aVoxelGridID); /*! @brief Constructor @pre aVoxelGridID needs to point to a valid grid position. */ MaskVoxel(const VoxelGridID& aVoxelGridID, FractionType aVolumeFraction); /*! @brief Operator == @return Return true if the id and volumeFraction are equal to these of the maskVoxel */ bool operator==(const MaskVoxel& maskVoxel) const; /*! @brief Operator < @return Return true if the id < the id of the maskVoxel */ bool operator<(const MaskVoxel& maskVoxel) const; const VoxelGridID& getVoxelGridID() const; void setRelevantVolumeFraction(const FractionType aVolumeFraction); FractionType getRelevantVolumeFraction() const; friend std::ostream& operator<<(std::ostream& s, const MaskVoxel& maskVoxel) { s << "( " << maskVoxel.getVoxelGridID() << ": " << maskVoxel.getRelevantVolumeFraction() << " )"; return s; }; }; } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/core/rttbNullPointerException.h b/code/core/rttbNullPointerException.h index dc2d2dd..c975e6c 100644 --- a/code/core/rttbNullPointerException.h +++ b/code/core/rttbNullPointerException.h @@ -1,40 +1,40 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __NULL_POINTER_EXCEPTION_H #define __NULL_POINTER_EXCEPTION_H #include #include "rttbException.h" #include "RTTBCoreExports.h" namespace rttb { namespace core { /*! @class NullPointerException @brief This exception will be thrown if any pointer is nullptr. */ class RTTBCore_EXPORT NullPointerException : public Exception { public: - NullPointerException(const std::string& aWhat): Exception(aWhat) {} + explicit NullPointerException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbPaddingException.h b/code/core/rttbPaddingException.h index c7618d8..0ca14ae 100644 --- a/code/core/rttbPaddingException.h +++ b/code/core/rttbPaddingException.h @@ -1,40 +1,40 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __PADDING_EXCEPTION_H #define __PADDING_EXCEPTION_H #include #include "rttbException.h" namespace rttb { namespace core { /*! @class PaddingException @brief This exception will be thrown if it can't be guaranteed that a transformation covers only a part of the target space. */ class PaddingException: public Exception { public: - PaddingException(const std::string& aWhat): Exception(aWhat) {} + explicit PaddingException(const std::string& aWhat): Exception(aWhat) {} }; } } #endif diff --git a/code/core/rttbStructure.h b/code/core/rttbStructure.h index 4746c98..2cb790f 100644 --- a/code/core/rttbStructure.h +++ b/code/core/rttbStructure.h @@ -1,107 +1,107 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __STRUCTURE_H #define __STRUCTURE_H #include #include #include "rttbBaseType.h" #include "rttbCommon.h" #include "RTTBCoreExports.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace core { /*! @class Structure @brief This is a class representing a RT Structure */ class RTTBCore_EXPORT Structure { public: rttbClassMacroNoParent(Structure); private: /*! @brief WorldCoordinate3D in mm */ PolygonSequenceType _structureVector; /*! @brief Contour Geometric Type using DICOM-RT definition (3006,0042). * POINT: indicates that the contour is a single point, defining a specific location of significance. * OPEN_PLANAR: indicates that the last vertex shall not be connected to the first point, and that all points * in Contour Data (3006,0050) shall be coplanar. * OPEN_NONPLANAR: indicates that the last vertex shall not be connected to the first point, and that the points * in Contour Data(3006,0050) may be non-coplanar. * CLOSED_PLANAR: indicates that the last point shall be connected to the first point, where the first point is * not repeated in the Contour Data. All points in Contour Data (3006,0050) shall be coplanar. */ std::vector _contourGeometricTypeVector; /*! @brief Structure UID*/ IDType _strUID; /*! @brief Structure Label*/ StructureLabel _label; public: /*! @brief Structure Standard Constructor uid will be randomly generated using boost::uuid library at first. To change the uid using setUID(). */ Structure(); /*! @brief Structure Constructor uid will be randomly generated using boost::uuid library at first. To change the uid using setUID(). */ - Structure(PolygonSequenceType strVector); + explicit Structure(PolygonSequenceType strVector); Structure(const Structure& copy); ~Structure(); const PolygonSequenceType& getStructureVector() const; /*! @brief Get the number of end points (points that define the polygon) of all contours of the structure. */ int getNumberOfEndpoints() const; IDType getUID() const; void setUID(const IDType& aUID); void setLabel(const StructureLabel& aLabel); StructureLabel getLabel() const; }; }//end namespace core }//end namespace rttb #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/indices/rttbDoseIndex.h b/code/indices/rttbDoseIndex.h index 61b4ea6..2b37d3c 100644 --- a/code/indices/rttbDoseIndex.h +++ b/code/indices/rttbDoseIndex.h @@ -1,83 +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. // //------------------------------------------------------------------------ #ifndef __DOSE_INDEX_H #define __DOSE_INDEX_H #include "rttbBaseType.h" #include "rttbDVHSet.h" #include "RTTBIndicesExports.h" namespace rttb { namespace indices { /*! @class DoseIndex @brief This is the interface for dose/plan comparison indices. @ingroup indices */ class RTTBIndices_EXPORT DoseIndex { protected: IndexValueType _value; DoseTypeGy _doseReference; /*! @brief If init() successful*/ bool _initSuccess; /*! @brief Initialize the calculation. It should be called in constructor or if any parameter of the calcualtion is changed. @return Return true if successfully @exception InvalidParameterException thrown if any input is invalid or index calculation failed */ bool init(); /*! @brief Dose index calculation */ virtual bool calcIndex() = 0; /*! @brief Check all inputs for the index calculation*/ virtual bool checkInputs() = 0; public: /*! @brief Constructor with the referece dose*/ - DoseIndex(DoseTypeGy aDoseReference); + explicit DoseIndex(DoseTypeGy aDoseReference); virtual ~DoseIndex(); /*! @brief Set the reference dose */ void setDoseReference(DoseTypeGy aDoseReference); /*! @brief Get the reference dose */ DoseTypeGy getDoseReference() const; /*! @brief Get the value of dose/plan comparison index @return Return the value of this index @exception Exception Thrown if the class was not initialized previously. */ IndexValueType getValue() const; /*! @brief Get the value of dose/plan comparison index for a treated volume with the index in the DVH treated volume set @param tvIndex index in the DVH in the current set of DVH subset for target volume: use DVHSet.getTargetVolumeSet() */ virtual IndexValueType getValueAt(const core::DVHSet::IndexType tvIndex) = 0; }; } } #endif diff --git a/code/interpolation/ITKTransformation/rttbITKTransformation.h b/code/interpolation/ITKTransformation/rttbITKTransformation.h index 3f907d3..5d16e53 100644 --- a/code/interpolation/ITKTransformation/rttbITKTransformation.h +++ b/code/interpolation/ITKTransformation/rttbITKTransformation.h @@ -1,76 +1,76 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_MAPPABLE_DOSE_ACCESSOR_H #define __ITK_MAPPABLE_DOSE_ACCESSOR_H #include #include "itkTransform.h" #include "rttbTransformationInterface.h" #include "RTTBInterpolationITKTransformationExports.h" namespace rttb { namespace interpolation { /*! @class ITKTransformation @brief This class can deal with dose information that has to be transformed into another geometry than the original dose image (transformation specified by ITK transformation object). */ class RTTBInterpolationITKTransformation_EXPORT ITKTransformation : public TransformationInterface { public: static const unsigned int InputDimension3D = 3; static const unsigned int OutputDimension3D = 3; using TransformScalarType = double; typedef itk::Transform Transform3D3DType; using InputPointType = Transform3D3DType::InputPointType; using OutputPointType = Transform3D3DType::OutputPointType; private: //! Has to be a Pointer type because of inheritance issues with itkSmartPointer (that doesn't recognize the inheritance) const Transform3D3DType* _pTransformation; protected: void convert(const WorldCoordinate3D& aWorldCoordinate, InputPointType& aInputPoint) const; void convert(const OutputPointType& aOutputPoint, WorldCoordinate3D& aWorldCoordinate) const; public: /*! @brief Constructor. @param aTransformation transformation in ITK format. @sa MappableDoseAccessorBase @pre all input parameters have to be valid @exception core::NullPointerException if one input parameter is nullptr @exception core::PaddingException if the transformation is undefined and if _acceptPadding==false */ - ITKTransformation(const Transform3D3DType* aTransformation); + explicit ITKTransformation(const Transform3D3DType* aTransformation); ~ITKTransformation() override = default; /*! @brief performs a transformation targetImage --> movingImage */ bool transformInverse(const WorldCoordinate3D& worldCoordinateTarget, WorldCoordinate3D& worldCoordinateMoving) const override; /*! @brief performs a transformation movingImage --> targetImage */ bool transform(const WorldCoordinate3D& worldCoordinateMoving, WorldCoordinate3D& worldCoordinateTarget) const override; }; } } #endif diff --git a/code/interpolation/MatchPointTransformation/rttbMatchPointTransformation.h b/code/interpolation/MatchPointTransformation/rttbMatchPointTransformation.h index b255571..219f063 100644 --- a/code/interpolation/MatchPointTransformation/rttbMatchPointTransformation.h +++ b/code/interpolation/MatchPointTransformation/rttbMatchPointTransformation.h @@ -1,75 +1,75 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __MATCHPOINT_TRANSFORMATION_H #define __MATCHPOINT_TRANSFORMATION_H #include "mapRegistration.h" #include "rttbTransformationInterface.h" #include "RTTBInterpolationMatchPointTransformationExports.h" namespace rttb { namespace interpolation { /*! @class MatchPointTransformation @brief This class can deal with dose information that has to be transformed into another geometry than the original dose image (transformation specified by MatchPoint registration object). @ingroup interpolation */ class RTTBInterpolationMatchPointTransformation_EXPORT MatchPointTransformation : public TransformationInterface { public: static const unsigned int TargetDimension3D = 3; static const unsigned int MovingDimension3D = 3; typedef map::core::Registration Registration3D3DType; typedef map::core::Registration::MovingPointType MovingPointType; typedef map::core::Registration::TargetPointType TargetPointType; /*! @brief Constructor. @param aRegistration registration given in MatchPoint format (note the use of pointer since itkSmartPointer does not support inheritance) @pre all input parameters have to be valid @exception core::NullPointerException if one input parameter is nullptr @exception core::PaddingException if the transformation is undefined and if _acceptPadding==false */ - MatchPointTransformation(const Registration3D3DType* aRegistration); + explicit MatchPointTransformation(const Registration3D3DType* aRegistration); ~MatchPointTransformation() override = default; /*! @brief performs a transformation targetImage --> movingImage */ bool transformInverse(const WorldCoordinate3D& worldCoordinateTarget, WorldCoordinate3D& worldCoordinateMoving) const override; /*! @brief performs a transformation movingImage --> targetImage */ bool transform(const WorldCoordinate3D& worldCoordinateMoving, WorldCoordinate3D& worldCoordinateTarget) const override; protected: void convert(const WorldCoordinate3D& aWorldCoordinate, TargetPointType& aTargetPoint) const; void convert(const MovingPointType& aMovingPoint, WorldCoordinate3D& aWorldCoordinate) const; private: //! Has to be a Pointer type because of inheritance issues with itkSmartPointer (that doesn't recognize the inheritance) const Registration3D3DType* _pRegistration; }; } } #endif diff --git a/code/io/dicom/rttbDVHDicomFileReader.h b/code/io/dicom/rttbDVHDicomFileReader.h index 15fb9e8..c8f68b6 100644 --- a/code/io/dicom/rttbDVHDicomFileReader.h +++ b/code/io/dicom/rttbDVHDicomFileReader.h @@ -1,53 +1,53 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DVH_DICOM_FILE_READER_H #define __DVH_DICOM_FILE_READER_H #include "rttbBaseType.h" #include "rttbDVHGeneratorInterface.h" namespace rttb { namespace io { namespace dicom { /*! @class DVHDicomFileReader @brief Read DVH data from a dicom file and create corresponding DVH object. */ class DVHDicomFileReader: public core::DVHGeneratorInterface { private: FileNameString _fileName; void createDVH(); public: /*! @brief DVHDicomFileReader Constructor @param aFileName the dicom dvh file name */ - DVHDicomFileReader(FileNameString aFileName); + explicit DVHDicomFileReader(FileNameString aFileName); /*! @brief Set the dicom dvh file name (triggers data import) @param aFileName the dicom dvh file name */ void setFileName(FileNameString aFileName); }; } } } #endif diff --git a/code/io/dicom/rttbDcmrtException.h b/code/io/dicom/rttbDcmrtException.h index ecda6e8..135f684 100644 --- a/code/io/dicom/rttbDcmrtException.h +++ b/code/io/dicom/rttbDcmrtException.h @@ -1,43 +1,43 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DCMRT_EXCEPTION_H #define __DCMRT_EXCEPTION_H #include #include "rttbException.h" namespace rttb { namespace io { namespace dicom { /*! @class DcmrtException @brief This class represents a DcmrtException. Any dcmrt error will throw this exception. */ class DcmrtException: public core::Exception { public: - DcmrtException(const std::string& aWhat): Exception(aWhat) {} + explicit DcmrtException(const std::string& aWhat): Exception(aWhat) {} }; } } } #endif diff --git a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h index 4846b62..50f581f 100644 --- a/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h +++ b/code/io/dicom/rttbDicomFileDoseAccessorGenerator.h @@ -1,71 +1,71 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DICOM_FILE_DOSE_ACCESSOR_GENERATOR_H #define __DICOM_FILE_DOSE_ACCESSOR_GENERATOR_H #include "dcmtk/config/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: using DRTDoseIODPtr = boost::shared_ptr; using DcmItemPtr = boost::shared_ptr; private: FileNameType _dicomDoseFileName; DicomFileDoseAccessorGenerator() = delete; protected: public: ~DicomFileDoseAccessorGenerator() override; /*! @brief Constructor. Initialization 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); + explicit 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() override ; }; } } } #endif diff --git a/code/io/dicom/rttbDicomFileStructureSetGenerator.h b/code/io/dicom/rttbDicomFileStructureSetGenerator.h index 659495e..082a1a6 100644 --- a/code/io/dicom/rttbDicomFileStructureSetGenerator.h +++ b/code/io/dicom/rttbDicomFileStructureSetGenerator.h @@ -1,89 +1,89 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ /* 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" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace io { namespace dicom { /*! @class DicomFileStructureSetGenerator @brief Generate a structure set from a corresponding dicomRT file. */ class DicomFileStructureSetGenerator: public core::StrVectorStructureSetGenerator { public: using StructTypePointer = core::Structure::Pointer; using StructureSetPointer = core::StructureSet::Pointer; using DRTStrSetIODPtr = boost::shared_ptr; private: IDType _UID; DICOMRTFileNameString _fileName; DicomFileStructureSetGenerator() = default; public: /*! @brief Constructor @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); + explicit DicomFileStructureSetGenerator(DICOMRTFileNameString aDICOMRTStrSetFileName); /*! @brief Destructor */ ~DicomFileStructureSetGenerator() override; /*! @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() override; }; } } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/io/dicom/rttbDicomIODDoseAccessorGenerator.h b/code/io/dicom/rttbDicomIODDoseAccessorGenerator.h index e2eaf11..95de522 100644 --- a/code/io/dicom/rttbDicomIODDoseAccessorGenerator.h +++ b/code/io/dicom/rttbDicomIODDoseAccessorGenerator.h @@ -1,69 +1,69 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DICOM_IOD_DOSE_ACCESSOR_GENERATOR_H #define __DICOM_IOD_DOSE_ACCESSOR_GENERATOR_H #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "drtdose.h" #include "rttbDoseAccessorGeneratorBase.h" namespace rttb { namespace io { namespace dicom { /*! @class DicomIODDoseAccessorGenerator @brief Generate DicomDoseAccessor with a DRTDoseIOD. */ class DicomIODDoseAccessorGenerator: public core::DoseAccessorGeneratorBase { public: using DRTDoseIODPtr = boost::shared_ptr; using DcmItemPtr = boost::shared_ptr; protected: private: DRTDoseIODPtr _doseIODPtr; DicomIODDoseAccessorGenerator() = delete; public: ~DicomIODDoseAccessorGenerator() override; /*! @brief Constructor. Initialization with a boost shared pointer of DRTDoseIOD */ - DicomIODDoseAccessorGenerator(DRTDoseIODPtr aDRTDoseIODP); + explicit DicomIODDoseAccessorGenerator(DRTDoseIODPtr aDRTDoseIODP); /*! @brief Generate DoseAccessor @return Return shared pointer of DoseAccessor. @exception InvalidDoseException Thrown if aDRTDoseIODP is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error */ DoseAccessorPointer generateDoseAccessor() override ; }; } } } #endif diff --git a/code/io/dicom/rttbDicomIODStructureSetGenerator.h b/code/io/dicom/rttbDicomIODStructureSetGenerator.h index f37ae17..4b5c3f6 100644 --- a/code/io/dicom/rttbDicomIODStructureSetGenerator.h +++ b/code/io/dicom/rttbDicomIODStructureSetGenerator.h @@ -1,84 +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. // //------------------------------------------------------------------------ /* 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_IOD_STRUCTURE_SET_GENERATOR_H #define __DICOM_IOD_STRUCTURE_SET_GENERATOR_H #include #include "drtstrct.h" #include "rttbBaseType.h" #include "rttbStrVectorStructureSetGenerator.h" namespace rttb { namespace io { namespace dicom { /*! @class DicomIODStructureSetGenerator @brief Generate a structure set from a DRTStructureSetIOD pointer. */ class DicomIODStructureSetGenerator: public core::StrVectorStructureSetGenerator { public: using StructTypePointer = core::Structure::Pointer; using StructureSetPointer = core::StructureSet::Pointer; using DRTStrSetIODPtr = boost::shared_ptr; private: DRTStrSetIODPtr _drtStrSetIOD; IDType _UID; /*! Import Structure data from file. @exception InvalidParameterException Thrown if the imported header tags are not numerical. */ void readStrSet(); /*! Replaces the character 'รก' ((int)-96) to ' ' ((int)32) in a string. */ void correctSpacesInROIName(std::string& roiName); public: /*! @brief Structure Constructor Get the vector of structures from DRTStructureSetIOD object @exception NullPointerException Thrown if structureSet is nullptr */ - DicomIODStructureSetGenerator(DRTStrSetIODPtr aDRTStructureSetIOD); + explicit DicomIODStructureSetGenerator(DRTStrSetIODPtr aDRTStructureSetIOD); /*! @brief Destructor */ ~DicomIODStructureSetGenerator() override; /*! @brief generate structure set @return return shared pointer of StructureSet @exception InvalidParameterException throw if the imported header tags are not numerical. */ StructureSetPointer generateStructureSet() override; }; } } } #endif diff --git a/code/io/helax/rttbDicomHelaxDoseAccessor.h b/code/io/helax/rttbDicomHelaxDoseAccessor.h index 0d5929d..6edce97 100644 --- a/code/io/helax/rttbDicomHelaxDoseAccessor.h +++ b/code/io/helax/rttbDicomHelaxDoseAccessor.h @@ -1,94 +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. // //------------------------------------------------------------------------ #ifndef __DICOM_HELAX_DOSE_ACCESSOR_H #define __DICOM_HELAX_DOSE_ACCESSOR_H #include #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "drtdose.h" #include "rttbBaseType.h" #include "rttbAccessorWithGeoInfoBase.h" namespace rttb { namespace io { namespace helax { /*! @class DicomHelaxDoseAccessor @brief Load dose data from a directory containing dicom dose files, each file describes the helax dose in one slice. */ class DicomHelaxDoseAccessor: public core::AccessorWithGeoInfoBase { public: using DRTDoseIODPtr = boost::shared_ptr; private: /*! vector of DRTDoseIOD shared pointers, each DRTDoseIOD pointer presents the dose in one slice*/ std::vector _doseVector; /*! vector of dose data(absolute Gy dose/doseGridScaling)*/ std::vector _doseData; double _doseGridScaling; IDType _doseUID; DicomHelaxDoseAccessor() = delete; protected: /*! @brief Initialize dose data @exception InvalidDoseException Thrown if any DRTDoseIOD pointer of _doseVector is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error @exception boost/bad_lexical_cast Thrown if the imported header tags are not numerical. */ bool begin(); /*! @brief get all required data from dicom information contained in _dose @exception boost/bad_lexical_cast Thrown if the imported header tags are not numerical. */ void assembleGeometricInfo() override; public: ~DicomHelaxDoseAccessor() override; /*! @brief Constructor. Initialisation with a vector of DRTDoseIOD pointers @exception InvalidDoseException Thrown if any DRTDoseIOD pointer of _doseVector is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error */ - DicomHelaxDoseAccessor(std::vector aDICOMRTDoseVector); + explicit DicomHelaxDoseAccessor(std::vector aDICOMRTDoseVector); GenericValueType getValueAt(const VoxelGridID aID) const override; GenericValueType getValueAt(const VoxelGridIndex3D& aIndex) const override; const IDType getUID() const override { return _doseUID; }; }; } } } #endif diff --git a/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.h b/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.h index 6a6a50c..65d686f 100644 --- a/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.h +++ b/code/io/helax/rttbDicomHelaxFileDoseAccessorGenerator.h @@ -1,73 +1,73 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DICOM_HELAX_FILE_DOSE_ACCESSOR_GENERATOR_H #define __DICOM_HELAX_FILE_DOSE_ACCESSOR_GENERATOR_H #include #include #include #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "drtdose.h" #include "rttbDoseAccessorGeneratorBase.h" #include "rttbBaseType.h" namespace rttb { namespace io { namespace helax { /*! @class DicomHelaxFileDoseAccessorGenerator @brief Load dose data from dicom helax files and generate DoseAccessor */ class DicomHelaxFileDoseAccessorGenerator: public core::DoseAccessorGeneratorBase { public: using DRTDoseIODPtr = boost::shared_ptr; protected: private: FileNameType _doseDirName; DicomHelaxFileDoseAccessorGenerator() = delete; public: ~DicomHelaxFileDoseAccessorGenerator() override; /*! @brief Constructor. Initialisation with a directory name */ - DicomHelaxFileDoseAccessorGenerator(FileNameType aDICOMRTDoseDirName); + explicit DicomHelaxFileDoseAccessorGenerator(FileNameType aDICOMRTDoseDirName); /*! @brief Generate DoseAccessor @return Return shared pointer of DoseAccessor. @exception InvalidParameterException Thrown if aDICOMRTDoseDirName is not found @exception InvalidDoseException Thrown if any loaded dose is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error */ DoseAccessorPointer generateDoseAccessor() override ; }; } } } #endif diff --git a/code/io/helax/rttbDicomHelaxIODVecDoseAccessorGenerator.h b/code/io/helax/rttbDicomHelaxIODVecDoseAccessorGenerator.h index 86716f8..f3f55c7 100644 --- a/code/io/helax/rttbDicomHelaxIODVecDoseAccessorGenerator.h +++ b/code/io/helax/rttbDicomHelaxIODVecDoseAccessorGenerator.h @@ -1,68 +1,68 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DICOM_HELAX_IOD_VEC_DOSE_ACCESSOR_GENERATOR_H #define __DICOM_HELAX_IOD_VEC_DOSE_ACCESSOR_GENERATOR_H #include #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "drtdose.h" #include "rttbDoseAccessorGeneratorBase.h" namespace rttb { namespace io { namespace helax { /*! @class DicomHelaxIODVecDoseAccessorGenerator @brief Generate DoseAccessor with a vector of DRTDoseIOD. */ class DicomHelaxIODVecDoseAccessorGenerator: public core::DoseAccessorGeneratorBase { public: using DRTDoseIODPtr = boost::shared_ptr; protected: private: std::vector _dosePtrVector; DicomHelaxIODVecDoseAccessorGenerator() = delete; public: ~DicomHelaxIODVecDoseAccessorGenerator() override; /*! @brief Constructor. Initialisation with a vector of DRTDoseIOD pointers */ - DicomHelaxIODVecDoseAccessorGenerator(std::vector& aDICOMRTDoseVector); + explicit DicomHelaxIODVecDoseAccessorGenerator(std::vector& aDICOMRTDoseVector); /*! @brief Generate DoseAccessor @return Return shared pointer of DoseAccessor. @exception InvalidDoseException Thrown if any DRTDoseIOD pointer of _doseVector is invalid: one of column/row/numberOfFrames/doseGridScaling/pixelSpacing=0 @exception DcmrtException Throw if dcmrt error */ DoseAccessorPointer generateDoseAccessor() override ; }; } } } #endif diff --git a/code/io/itk/rttbFileDispatch.h b/code/io/itk/rttbFileDispatch.h index 71128da..62b227a 100644 --- a/code/io/itk/rttbFileDispatch.h +++ b/code/io/itk/rttbFileDispatch.h @@ -1,62 +1,62 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/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. // //------------------------------------------------------------------------ #ifndef __RTTB_FILE_DISPATCH_H #define __RTTB_FILE_DISPATCH_H #include #include "rttbBaseType.h" namespace rttb { namespace core { /*! @class FileDispatch @brief Convenience functions for working with files and path @note code copied from MatchPoint, see documentation (http://sourceforge.net/projects/matchpoint/) */ class FileDispatch { public: /** Returns the name of the file (without extension).*/ static FileNameString getName(const FileNameString& sFilePath); /** Returns the extansion of the file (dot included).*/ static FileNameString getExtension(const FileNameString& sFilePath); /** Returns name of the file plus extension.*/ static FileNameString getFullName(const FileNameString& sFilePath); /** Returns the directory the file is located in (without trailing slash). * @remark this function always removes the last element of the path. Thus * if you pass a path without a file, it will return the parent directory.*/ static FileNameString getPath(const FileNameString& sFilePath); /** Convertes all path seperators in the seperators used in the current OS.*/ static FileNameString ensureCorrectOSPathSeparator(const FileNameString& path); FileNameString getName(); FileNameString getExtension(); FileNameString getFullName(); FileNameString getPath(); - FileDispatch(const FileNameString& filePath); + explicit FileDispatch(const FileNameString& filePath); private: FileNameString _fileName; }; }//end namespace core }//end namespace rttb #endif diff --git a/code/io/itk/rttbITKException.h b/code/io/itk/rttbITKException.h index 13e66da..8c2e1fe 100644 --- a/code/io/itk/rttbITKException.h +++ b/code/io/itk/rttbITKException.h @@ -1,43 +1,43 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_EXCEPTION_H #define __ITK_EXCEPTION_H #include #include "rttbException.h" namespace rttb { namespace io { namespace itk { /*! @class ITKException @brief This class represents a ITKException. Any itk error will throw this exception. */ class ITKException: public core::Exception { public: - ITKException(const std::string& aWhat): Exception(aWhat) {} + explicit ITKException(const std::string& aWhat): Exception(aWhat) {} }; } } } #endif diff --git a/code/io/itk/rttbITKImageAccessor.h b/code/io/itk/rttbITKImageAccessor.h index 655a759..a22ff04 100644 --- a/code/io/itk/rttbITKImageAccessor.h +++ b/code/io/itk/rttbITKImageAccessor.h @@ -1,84 +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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_ACCESSOR_H #define __ITK_IMAGE_ACCESSOR_H #include "rttbAccessorWithGeoInfoBase.h" #include "rttbBaseType.h" #include "itkImage.h" #include "RTTBITKIOExports.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageAccessor @brief This class gives access to information stored in an itk image @details There is no value scaling, i.e., it is assumed that the values in the itkImage are absolute. */ class RTTBITKIO_EXPORT ITKImageAccessor : public core::AccessorWithGeoInfoBase { public: typedef ::itk::Image ITKImageType; private: /** @brief The dose as itkImage */ ITKImageType::ConstPointer _data; IDType _UID; /*! @brief constructor @exception InvalidDoseException if _dose is nullptr */ ITKImageAccessor() = delete; /*! @brief get all required data from the itk image contained in _dose @exception InvalidDoseException if PixelSpacing is 0 or size in any dimension is 0. */ void assembleGeometricInfo() override; public: ~ITKImageAccessor() override; /*! @brief Constructor. Initialization with a itk image @pre image must be a valid instance (and !nullptr) @note the doseImage pixels are assumed absolute */ - ITKImageAccessor(ITKImageType::ConstPointer image); + explicit ITKImageAccessor(ITKImageType::ConstPointer image); /*! @brief returns the dose for an id */ GenericValueType getValueAt(const VoxelGridID aID) const override; /*! @brief returns the dose for an index */ GenericValueType getValueAt(const VoxelGridIndex3D& aIndex) const override; const IDType getUID() const override { return _UID; }; }; } } } #endif diff --git a/code/io/itk/rttbITKImageAccessorConverter.h b/code/io/itk/rttbITKImageAccessorConverter.h index a4be81a..0fe3309 100644 --- a/code/io/itk/rttbITKImageAccessorConverter.h +++ b/code/io/itk/rttbITKImageAccessorConverter.h @@ -1,65 +1,65 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_ACCESSOR_CONVERTER_H #define __ITK_IMAGE_ACCESSOR_CONVERTER_H #include "rttbDoseAccessorProcessorBase.h" #include "rttbDoseAccessorConversionSettingInterface.h" #include "itkImage.h" #include "RTTBITKIOExports.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageAccessorConverter @brief Class converts/dumps the processed accessor into an itk image @remark DoseAccessorConversionInterface defines how the converter should react on non valid dose values. */ class RTTBITKIO_EXPORT ITKImageAccessorConverter : public core::DoseAccessorProcessorBase, public core::DoseAccessorConversionSettingInterface { public: typedef ::itk::Image ITKImageType; using DoseAccessorPointer = core::DoseAccessorInterface::Pointer; bool process() override; ITKImageType::Pointer getITKImage() { return _itkImage; } - ITKImageAccessorConverter(DoseAccessorPointer accessor); + explicit ITKImageAccessorConverter(DoseAccessorPointer accessor); ~ITKImageAccessorConverter() override = default; private: ITKImageAccessorConverter(const ITKImageAccessorConverter&) = delete; //not implemented on purpose -> non-copyable ITKImageAccessorConverter& operator=(const ITKImageAccessorConverter&) = delete;//not implemented on purpose -> non-copyable ITKImageType::Pointer _itkImage; }; } } } #endif diff --git a/code/io/itk/rttbITKImageAccessorGenerator.h b/code/io/itk/rttbITKImageAccessorGenerator.h index e972f20..65e6470 100644 --- a/code/io/itk/rttbITKImageAccessorGenerator.h +++ b/code/io/itk/rttbITKImageAccessorGenerator.h @@ -1,66 +1,66 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_ACCESSOR_GENERATOR_H #define __ITK_IMAGE_ACCESSOR_GENERATOR_H #include "rttbDoseAccessorGeneratorBase.h" #include "itkImage.h" #include "RTTBITKIOExports.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageAccessorGenerator @brief Generate ITKImageAccessor wrapping an itk image as object (not as file). @note it implies that the information is stored in absolute values. */ class RTTBITKIO_EXPORT ITKImageAccessorGenerator : public core::DoseAccessorGeneratorBase { public: typedef ::itk::Image ITKImageType; using DoseAccessorPointer = DoseAccessorGeneratorBase::DoseAccessorPointer; private: /** @brief The dose as itkImage */ ITKImageType::ConstPointer _dosePtr; ITKImageAccessorGenerator() = delete; public: ~ITKImageAccessorGenerator() override = default; /*! @pre aDoseImage must point to a valid instance. @exception InvalidDoseException Thrown if aDoseImage is invalid. */ - ITKImageAccessorGenerator(const ITKImageType* aDoseImage); + explicit ITKImageAccessorGenerator(const ITKImageType* aDoseImage); /*! @brief Generate DoseAccessor @return Return shared pointer of DoseAccessor. */ DoseAccessorPointer generateDoseAccessor() override ; }; } } } #endif diff --git a/code/io/itk/rttbITKImageFileMaskAccessorGenerator.h b/code/io/itk/rttbITKImageFileMaskAccessorGenerator.h index 2593c53..3974714 100644 --- a/code/io/itk/rttbITKImageFileMaskAccessorGenerator.h +++ b/code/io/itk/rttbITKImageFileMaskAccessorGenerator.h @@ -1,67 +1,67 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_MASK_FILE_ACCESSOR_GENERATOR_H #define __ITK_IMAGE_MASK_FILE_ACCESSOR_GENERATOR_H #include "rttbMaskAccessorGeneratorBase.h" #include "rttbBaseType.h" #include "rttbITKImageMaskAccessor.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageFileMaskAccessorGenerator @brief Load 3D Mask data using the itk loading methods and wraps the resulting itk image in a ITKImageMaskAccessor. * this is normally used if Mask distributions are stored in formats like meta image, nrrd... */ class ITKImageFileMaskAccessorGenerator: public core::MaskAccessorGeneratorBase { public: using MaskAccessorPointer = MaskAccessorGeneratorBase::MaskAccessorPointer; private: FileNameType _itkMaskFileName; /** @brief The mask as itkImage */ ITKImageMaskAccessor::ITKMaskImageType::Pointer _itkDoubleImage; ITKImageFileMaskAccessorGenerator() = delete; public: ~ITKImageFileMaskAccessorGenerator() override; - ITKImageFileMaskAccessorGenerator(const FileNameType& fileName); + explicit ITKImageFileMaskAccessorGenerator(const FileNameType& fileName); /*! @brief Generate MaskAccessor @return Return shared pointer of MaskAccessor. @exception InvalidDoseException Thrown if file could not be read @exception InvalidParameterException Thrown if file has imageDimension !=3 or image component type != SCALAR @details is always converted into a itkImage by using a CastImageFilter @sa doCasting, handleGenericImage */ MaskAccessorPointer generateMaskAccessor() override; }; }//end namespace itk }//end namespace io }//end namespace rttb #endif diff --git a/code/io/itk/rttbITKImageMaskAccessor.h b/code/io/itk/rttbITKImageMaskAccessor.h index 2dca57c..b49ebc1 100644 --- a/code/io/itk/rttbITKImageMaskAccessor.h +++ b/code/io/itk/rttbITKImageMaskAccessor.h @@ -1,115 +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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_MASK_ACCESSOR_H #define __ITK_IMAGE_MASK_ACCESSOR_H #include "rttbMaskAccessorInterface.h" #include "rttbBaseType.h" #include "rttbGeometricInfo.h" #include "itkImage.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace rttb { namespace io { namespace itk { /*! @class ITKImageMaskAccessor @brief This class gives access to mask information stored in an itk image */ class ITKImageMaskAccessor: public core::MaskAccessorInterface { public: typedef ::itk::Image ITKMaskImageType; using ITKImageBaseType = ::itk::ImageBase<3>; using MaskVoxelList = core::MaskAccessorInterface::MaskVoxelList; using MaskVoxelListPointer = core::MaskAccessorInterface::MaskVoxelListPointer; private: /** @brief The mask as itkImage */ ITKMaskImageType::ConstPointer _mask; IDType _maskUID; core::GeometricInfo::Pointer _geoInfo; /*! vector containing list of mask voxels*/ MaskVoxelListPointer _relevantVoxelVector; /*! @brief get all required data from the itk image contained in _Mask @exception InvalidDoseException if PixelSpacing is 0 or size in any dimension is 0. */ bool assembleGeometricInfo(); public: ~ITKImageMaskAccessor() override; - ITKImageMaskAccessor(ITKMaskImageType::ConstPointer aMaskImage); + explicit ITKImageMaskAccessor(ITKMaskImageType::ConstPointer aMaskImage); /*! @brief voxelization of the given structures according to the original RTToolbox algorithm*/ void updateMask() override; /*! @brief get vector conatining al relevant voxels that are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector() override; /*! @brief get vector conatining al relevant voxels that have a relevant volume above the given threshold and are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector(float lowerThreshold) override; /*!@brief determine how a given voxel on the dose grid is masked * @param aID ID of the voxel in grid. * @param voxel Reference to the voxel. * @post after a valid call voxel contains the information of the specified grid voxel. If aID is not valid, voxel values are undefined. * The relevant volume fraction will be set to zero. * @return Indicates of the voxel exists and therefore if parameter voxel contains valid values.*/ bool getMaskAt(const VoxelGridID aID, core::MaskVoxel& voxel) const override; bool getMaskAt(const VoxelGridIndex3D& aIndex, core::MaskVoxel& voxel) const override; /*! @brief give access to GeometricInfo*/ const core::GeometricInfo& getGeometricInfo() const override; /* @ brief is true if Mask is on a homogeneous grid */ // Inhomogeneous grids are not supported at the moment, but if they will // be supported in the future the interface does not need to change. bool isGridHomogeneous() const override { return true; }; IDType getMaskUID() const override { return _maskUID; }; }; } } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/code/io/itk/rttbITKImageMaskAccessorConverter.h b/code/io/itk/rttbITKImageMaskAccessorConverter.h index fba46e6..4b6e686 100644 --- a/code/io/itk/rttbITKImageMaskAccessorConverter.h +++ b/code/io/itk/rttbITKImageMaskAccessorConverter.h @@ -1,65 +1,65 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_MASK_ACCESSOR_CONVERTER_H #define __ITK_IMAGE_MASK_ACCESSOR_CONVERTER_H #include "rttbITKImageMaskAccessor.h" #include "rttbMaskAccessorProcessorBase.h" #include "../itk/rttbDoseAccessorConversionSettingInterface.h" #include "RTTBITKIOExports.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageMaskAccessorConverter @brief Class converts/dumps the processed accessor into an itk image @remark MaskAccessorConversionInterface defines how the converter should react on non valid Mask values. */ class RTTBITKIO_EXPORT ITKImageMaskAccessorConverter : public core::MaskAccessorProcessorBase, public rttb::core::DoseAccessorConversionSettingInterface { public: using MaskAccessorPointer = core::MaskAccessorInterface::Pointer; bool process() override; const ITKImageMaskAccessor::ITKMaskImageType::Pointer getITKImage() { return _itkImage; } - ITKImageMaskAccessorConverter(MaskAccessorPointer accessor); + explicit ITKImageMaskAccessorConverter(MaskAccessorPointer accessor); ~ITKImageMaskAccessorConverter() override = default; private: ITKImageMaskAccessorConverter(const ITKImageMaskAccessorConverter&) = delete; //not implemented on purpose -> non-copyable ITKImageMaskAccessorConverter& operator=(const ITKImageMaskAccessorConverter&) = delete;//not implemented on purpose -> non-copyable ITKImageMaskAccessor::ITKMaskImageType::Pointer _itkImage; }; } } } #endif diff --git a/code/io/itk/rttbITKImageMaskAccessorGenerator.h b/code/io/itk/rttbITKImageMaskAccessorGenerator.h index f93dddd..cc0a1c7 100644 --- a/code/io/itk/rttbITKImageMaskAccessorGenerator.h +++ b/code/io/itk/rttbITKImageMaskAccessorGenerator.h @@ -1,63 +1,63 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __ITK_IMAGE_MASK_ACCESSOR_GENERATOR_H #define __ITK_IMAGE_MASK_ACCESSOR_GENERATOR_H #include "rttbITKImageMaskAccessor.h" #include "rttbMaskAccessorGeneratorBase.h" #include "RTTBITKIOExports.h" namespace rttb { namespace io { namespace itk { /*! @class ITKImageMaskAccessorGenerator @brief Generate ITKImageMaskAccessor wrapping an itk image as object (not as file). */ class RTTBITKIO_EXPORT ITKImageMaskAccessorGenerator : public core::MaskAccessorGeneratorBase { public: using MaskAccessorPointer = MaskAccessorGeneratorBase::MaskAccessorPointer; private: /** @brief The Mask as itkImage */ ITKImageMaskAccessor::ITKMaskImageType::ConstPointer _maskPtr; ITKImageMaskAccessorGenerator() = delete; public: ~ITKImageMaskAccessorGenerator() override = default; /*! @pre aMaskImage must point to a valid instance. @exception InvalidDoseException Thrown if aMaskImage is invalid. */ - ITKImageMaskAccessorGenerator(const ITKImageMaskAccessor::ITKMaskImageType* aMaskImage); + explicit ITKImageMaskAccessorGenerator(const ITKImageMaskAccessor::ITKMaskImageType* aMaskImage); /*! @brief Generate MaskAccessor @return Return shared pointer of MaskAccessor. */ MaskAccessorPointer generateMaskAccessor() override ; }; } } } #endif diff --git a/code/io/other/rttbDVHXMLFileReader.h b/code/io/other/rttbDVHXMLFileReader.h index 5b1cd6f..01e8e60 100644 --- a/code/io/other/rttbDVHXMLFileReader.h +++ b/code/io/other/rttbDVHXMLFileReader.h @@ -1,64 +1,64 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DVH_XML_FILE_READER_H #define __DVH_XML_FILE_READER_H #include "rttbBaseType.h" #include "rttbDVHGeneratorInterface.h" namespace rttb { namespace io { namespace other { /*! @class DVHXMLFileReader @brief Reads DVH data from xml files. */ class DVHXMLFileReader: public core::DVHGeneratorInterface { private: FileNameString _fileName; bool _resetFile; /*! @brief Create new DVH object using the info from dvh txt file @exception InvalidParameterException Thrown if _fileName invalid */ void createDVH(); public: /*! @brief Constructor. */ - DVHXMLFileReader(FileNameString aFileName); + explicit DVHXMLFileReader(FileNameString aFileName); ~DVHXMLFileReader(); /*! @brief Change file name. */ void resetFileName(FileNameString aFileName); /*! @brief Generate DVH, createDVH() will be called @return Return new shared pointer of DVH. @exception InvalidParameterException Thrown if _fileName invalid */ core::DVH::Pointer generateDVH() override; }; } } } #endif diff --git a/code/io/other/rttbDoseStatisticsXMLReader.h b/code/io/other/rttbDoseStatisticsXMLReader.h index 79aff6f..73bf445 100644 --- a/code/io/other/rttbDoseStatisticsXMLReader.h +++ b/code/io/other/rttbDoseStatisticsXMLReader.h @@ -1,58 +1,58 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __DOSE_STATISTICS_XML_READER_H #define __DOSE_STATISTICS_XML_READER_H #include "rttbDoseStatistics.h" namespace rttb { namespace io { namespace other { /*! @class DoseStatisticsXMLReader @brief Reads a dose statistics XML into a DoseStatistics object */ class DoseStatisticsXMLReader{ public: - DoseStatisticsXMLReader(const std::string& filename); + explicit DoseStatisticsXMLReader(const std::string& filename); ~DoseStatisticsXMLReader(); void setFilename(const std::string& filename); /*! @brief Generate a Model, createModel() will be called @return Return new shared pointer of a Model. @exception InvalidParameterException Thrown if _filename invalid */ algorithms::DoseStatistics::Pointer generateDoseStatistic(); private: std::string _filename; bool _newFile; algorithms::DoseStatistics::Pointer _doseStatistic; /*! @brief Create new Model object using the info from model xml file @exception InvalidParameterException Thrown if _filename invalid */ void createDoseStatistic(); }; } } } #endif diff --git a/code/masks/rttbGenericMutableMaskAccessor.h b/code/masks/rttbGenericMutableMaskAccessor.h index f85cb7d..8507805 100644 --- a/code/masks/rttbGenericMutableMaskAccessor.h +++ b/code/masks/rttbGenericMutableMaskAccessor.h @@ -1,102 +1,102 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __GENERIC_MUTABLE_MASK_ACCESSOR_H #define __GENERIC_MUTABLE_MASK_ACCESSOR_H #include "rttbMutableMaskAccessorInterface.h" #include "rttbBaseType.h" #include "rttbGeometricInfo.h" namespace rttb { namespace masks { /*! @class GenericMutableMaskAccessor @brief Default implementation of MutableMaskAccessorInterface. @see MutableMaskAccessorInterface */ class GenericMutableMaskAccessor: public core::MutableMaskAccessorInterface { public: using MaskVoxelList = core::MutableMaskAccessorInterface::MaskVoxelList; using MaskVoxelListPointer = core::MutableMaskAccessorInterface::MaskVoxelListPointer; private: core::GeometricInfo _geoInfo; /*! vector containing list of mask voxels*/ MaskVoxelListPointer _spRelevantVoxelVector; IDType _maskUID; GenericMutableMaskAccessor(const GenericMutableMaskAccessor&) = delete; //not implemented on purpose -> non-copyable GenericMutableMaskAccessor& operator=(const GenericMutableMaskAccessor&) = delete;//not implemented on purpose -> non-copyable public: ~GenericMutableMaskAccessor() override; - GenericMutableMaskAccessor(const core::GeometricInfo& aGeometricInfo); + explicit GenericMutableMaskAccessor(const core::GeometricInfo& aGeometricInfo); /*! @brief initialize mask structure if _spRelevantVoxelVector was not previously initialized*/ void updateMask() override; /*! @brief get vector containing all relevant voxels that are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector() override; /*! @brief get vector containing all relevant voxels that have a relevant volume above the given threshold and are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector(float lowerThreshold) override; /*!@brief determine how a given voxel on the dose grid is masked * @param aID ID of the voxel in grid. * @param voxel Reference to the voxel. * @post after a valid call voxel contains the information of the specified grid voxel. If aID is not valid, voxel values are undefined. * The relevant volume fraction will be set to zero. * @return Indicates if the voxel exists and therefore if parameter voxel contains valid values.*/ bool getMaskAt(const VoxelGridID aID, core::MaskVoxel& voxel) const override; bool getMaskAt(const VoxelGridIndex3D& aIndex, core::MaskVoxel& voxel) const override; /* @ brief is true if dose is on a homogeneous grid */ // Inhomogeneous grids are not supported at the moment, but if they will // be supported in the future the interface does not need to change. bool isGridHomogeneous() const override { return true; }; /*! @brief give access to GeometricInfo*/ inline const core::GeometricInfo& getGeometricInfo() const override { return _geoInfo; }; IDType getMaskUID() const override { return _maskUID; }; void setMaskAt(VoxelGridID aID, const core::MaskVoxel& voxel) override; void setMaskAt(const VoxelGridIndex3D& gridIndex, const core::MaskVoxel& voxel) override; void setRelevantVoxelVector(MaskVoxelListPointer aVoxelListPointer) override; }; } } #endif \ No newline at end of file diff --git a/code/models/rttbBioModel.h b/code/models/rttbBioModel.h index 6fef77d..d89cda6 100644 --- a/code/models/rttbBioModel.h +++ b/code/models/rttbBioModel.h @@ -1,104 +1,104 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __BIO_MODEL_H #define __BIO_MODEL_H #include "rttbDVH.h" #include "rttbBaseTypeModels.h" #include #include "RTTBModelsExports.h" #include namespace rttb { namespace models { /*! @class BioModel @brief This is the interface class for biological models */ class RTTBModels_EXPORT BioModel { public: rttbClassMacroNoParent(BioModel) using ParamVectorType = std::vector; using DVHPointer = core::DVH::Pointer; protected: DVHPointer _dvh; BioModelValueType _value{0}; /*! @brief Calculate the model value @param doseFactor scaling factor for the dose. The model calculation will use the dvh with each di=old di*doseFactor. */ virtual BioModelValueType calcModel(const double doseFactor = 1) = 0; /* Map of all parameters */ std::map parameterMap; std::string _name; public: BioModel() = default; - BioModel(DVHPointer aDvh): _dvh(aDvh), _value(0) {}; + explicit BioModel(DVHPointer aDvh): _dvh(aDvh), _value(0) {}; virtual ~BioModel()= default; /*! @brief Start the calculation. If any parameter changed, init() should be called again and return =true before getValue() is called! @return Return true if successful */ bool init(const double doseFactor = 1); /*! @param aDVH must be a DVH calculated by a cumulative dose distribution, not a fraction DVH! */ void setDVH(const DVHPointer aDVH); const DVHPointer getDVH() const; /*! @brief Set parameter vector, where index of vector is the parameter ID. */ virtual void setParameterVector(const ParamVectorType& aParameterVector) = 0; virtual void setParameterByID(const int aParamId, const BioModelParamType aValue) = 0; /*! @brief Get parameter by ID. @return Return -1 if ID is not found. */ virtual const int getParameterID(const std::string& aParamName) const = 0; virtual std::map getParameterMap() const = 0; virtual void fillParameterMap() = 0 ; virtual std::string getModelType() const = 0; /*! @brief Get the value of biological model @pre init() must be called and =true! */ const BioModelValueType getValue() const; }; }//end namespace models }//end namespace rttb #endif diff --git a/code/models/rttbNTCPModel.h b/code/models/rttbNTCPModel.h index 8648bfa..6416c9f 100644 --- a/code/models/rttbNTCPModel.h +++ b/code/models/rttbNTCPModel.h @@ -1,57 +1,57 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __NTCP_MODEL_H #define __NTCP_MODEL_H #include "rttbBioModel.h" #include "rttbBaseTypeModels.h" namespace rttb { namespace models { /*! @class NTCPModel @brief This is the interface class for NTCP(Normal Tissue Complication Probability) models */ class NTCPModel: public BioModel { public: using ParamVectorType = BioModel::ParamVectorType; protected: BioModelParamType _d50{0}; public: NTCPModel(): BioModel() {} - NTCPModel(const BioModelParamType aD50): BioModel(), _d50(aD50) {} + explicit NTCPModel(const BioModelParamType aD50): BioModel(), _d50(aD50) {} NTCPModel(core::DVH::Pointer aDvh, const BioModelParamType aD50): BioModel(aDvh), _d50(aD50) {} const BioModelParamType getD50() { return _d50; } void setD50(const BioModelParamType aD50) { _d50 = aD50; } }; }//end namespace models }//end namespace rttb #endif diff --git a/code/models/rttbTCPModel.h b/code/models/rttbTCPModel.h index 652903e..03169a4 100644 --- a/code/models/rttbTCPModel.h +++ b/code/models/rttbTCPModel.h @@ -1,56 +1,56 @@ // ----------------------------------------------------------------------- // 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. // //------------------------------------------------------------------------ #ifndef __TCP_MODEL_H #define __TCP_MODEL_H #include "rttbBioModel.h" namespace rttb { namespace models { /*! @class TCPModel @brief This is the interface class for TCP(Tumor Control Probability) models */ class TCPModel: public BioModel { public: using ParamVectorType = BioModel::ParamVectorType; protected: int _numberOfFractions{0}; public: TCPModel(): BioModel() {}; - TCPModel(int aNum): BioModel(), _numberOfFractions(aNum) {}; + explicit TCPModel(int aNum): BioModel(), _numberOfFractions(aNum) {}; TCPModel(core::DVH::Pointer aDvh, int aNum): BioModel(aDvh), _numberOfFractions(aNum) {}; void setNumberOfFractions(const int aNumberOfFractions); const int getNumberOfFractions(); }; }//end namespace models }//end namespace rttb #endif