diff --git a/code/core/rttbMaskVoxel.h b/code/core/rttbMaskVoxel.h index 8afcac0..50fc3fe 100644 --- a/code/core/rttbMaskVoxel.h +++ b/code/core/rttbMaskVoxel.h @@ -1,92 +1,96 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) */ #ifndef __MASK_VOXEL_NEW_H #define __MASK_VOXEL_NEW_H #include "rttbBaseType.h" 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 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); /*! @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); /*! @brief Set the volume fraction of current voxel inside a given structure @deprecated Please use setRelevantVolumeFraction instead. @see setRelevantVolumeFraction */ void setProportionInStr(const FractionType aFraction){ setRelevantVolumeFraction(aFraction); }; FractionType getRelevantVolumeFraction() const; /*! @brief Get the volume fraction of current voxel inside a given structure @deprecated Please use getRelevantVolumeFraction instead. @see getRelevantVolumeFraction */ FractionType getProportionInStr() const{ return getRelevantVolumeFraction(); }; friend std::ostream& operator<<(std::ostream& s, const MaskVoxel& maskVoxel){ s << "( " << maskVoxel.getVoxelGridID() << ": " << maskVoxel.getRelevantVolumeFraction() << " )"; return s; }; }; } } #endif diff --git a/code/masks/rttbBoostMask.cpp b/code/masks/rttbBoostMask.cpp index 78690cd..2680d04 100644 --- a/code/masks/rttbBoostMask.cpp +++ b/code/masks/rttbBoostMask.cpp @@ -1,260 +1,262 @@ #include #include #include #include #include #include #include #include #include "rttbBoostMask.h" #include "rttbNullPointerException.h" #include "rttbInvalidParameterException.h" namespace rttb{ namespace masks{ - BoostMask::BoostMask(BoostMask::GeometricInfoPtr aDoseGeoInfo, BoostMask::StrPtr aStructure) + BoostMask::BoostMask(BoostMask::GeometricInfoPointer aDoseGeoInfo, BoostMask::StructPointer aStructure) :_geometricInfo(aDoseGeoInfo), _structure(aStructure), _voxelInStructure(boost::make_shared()){ if(! _geometricInfo ){ throw rttb::core::NullPointerException("Error: Geometric info is NULL!"); } else if(!_structure){ throw rttb::core::NullPointerException("Error: Structure is NULL!"); } + } + + void BoostMask::calcMask(){ if(hasSelfIntersections()){ throw rttb::core::InvalidParameterException("Error: structure has self intersections!"); } - - for(unsigned int i=0; i< aDoseGeoInfo->getNumSlices(); i++){ - std::vector voxelList = getBoundingBox(i); + for(unsigned int i=0; i< _geometricInfo->getNumSlices(); i++){ + VoxelIndexVector voxelList = getBoundingBox(i); rttb::VoxelGridIndex3D gridIndex3D0 = voxelList.at(0); rttb::VoxelGridIndex3D gridIndex3D1 = voxelList.at(1); for(unsigned int indexX = gridIndex3D0[0] ; indexX <= gridIndex3D1[0]; indexX ++ ){ for(unsigned int indexY = gridIndex3D0[1]; indexY <= gridIndex3D1[1]; indexY ++){ rttb::VoxelGridIndex3D currentIndex; currentIndex[0] = indexX; currentIndex[1] = indexY; currentIndex[2] = i; rttb::VoxelGridID gridID; _geometricInfo->convert(currentIndex, gridID); std::deque polygons = getIntersections(currentIndex); double intersectionArea = calcArea(polygons); double voxelSize = _geometricInfo->getSpacing()[0] * _geometricInfo->getSpacing()[1]; if(intersectionArea > 0) { double volumeFraction = intersectionArea/voxelSize; if(volumeFraction > 1 && (volumeFraction-1) <= 0.0001){ volumeFraction = 1; } core::MaskVoxel maskVoxel = core::MaskVoxel(gridID, (volumeFraction)); _voxelInStructure->push_back(maskVoxel);//push back the mask voxel in structure } } } } sort(_voxelInStructure->begin(), _voxelInStructure->end()); - } bool BoostMask::hasSelfIntersections(){ bool hasSelfIntersection = false; for(unsigned int indexZ=0; indexZ< _geometricInfo->getNumSlices(); indexZ++){ rttb::VoxelGridIndex3D currentIndex(0,0,indexZ); - std::vector boostPolygons = getIntersectionSlicePolygons(currentIndex); + BoostMask::BoostRingVector boostPolygons = getIntersectionSlicePolygons(currentIndex); for(unsigned int i =0; i intersection; + BoostPolygonDeque intersection; boost::geometry::intersection(boostPolygons.at(i), boostPolygons.at(j), intersection); if(intersection.size()>0){ hasSelfIntersection = true; std::cout << "Has self intersection! Slice: "<< indexZ << ", polygon "< BoostMask::getBoundingBox(unsigned int sliceNumber){ + BoostMask::VoxelIndexVector BoostMask::getBoundingBox(unsigned int sliceNumber){ if(sliceNumber<0 || sliceNumber >= _geometricInfo->getNumSlices()){ throw rttb::core::InvalidParameterException(std::string("Error: slice number is invalid!")); } rttb::VoxelGridIndex3D currentIndex(0,0,sliceNumber); - std::vector boostPolygons = getIntersectionSlicePolygons(currentIndex); + BoostRingVector boostPolygons = getIntersectionSlicePolygons(currentIndex); double xMin = 0; double yMin = 0; double xMax = 0; double yMax = 0; for(unsigned int i =0; i box; boost::geometry::envelope(boostPolygons.at(i), box); BoostPoint2D minPoint = box.min_corner(); BoostPoint2D maxPoint = box.max_corner(); if(i==0){ xMin = minPoint.x(); yMin = minPoint.y(); xMax = maxPoint.x(); yMax = maxPoint.y(); } xMin = std::min(xMin, minPoint.x()); yMin = std::min(yMin, minPoint.y()); xMax = std::max(xMax, maxPoint.x()); yMax = std::max(yMax, maxPoint.y()); } rttb::WorldCoordinate3D nullWorldCoord; _geometricInfo->indexToWorldCoordinate(VoxelGridIndex3D(0,0,0),nullWorldCoord); rttb::WorldCoordinate3D minWorldCoord(xMin, yMin, nullWorldCoord.z()); rttb::WorldCoordinate3D maxWorldCoord(xMax, yMax, nullWorldCoord.z()); rttb::VoxelGridIndex3D index0; rttb::VoxelGridIndex3D index1; _geometricInfo->worldCoordinateToIndex(minWorldCoord, index0); _geometricInfo->worldCoordinateToIndex(maxWorldCoord, index1); - std::vector voxelList; + VoxelIndexVector voxelList; voxelList.push_back(index0); voxelList.push_back(index1); return voxelList; } /*Get intersection polygons of the contour and a voxel polygon*/ - std::deque BoostMask::getIntersections(const rttb::VoxelGridIndex3D& aVoxelIndex3D){ - std::deque polygonDeque; + BoostMask::BoostPolygonDeque BoostMask::getIntersections(const rttb::VoxelGridIndex3D& aVoxelIndex3D){ + BoostMask::BoostPolygonDeque polygonDeque; BoostRing2D voxelPolygon = get2DContour(aVoxelIndex3D); boost::geometry::correct(voxelPolygon); - std::vector contourVector = getIntersectionSlicePolygons(aVoxelIndex3D); + BoostMask::BoostRingVector contourVector = getIntersectionSlicePolygons(aVoxelIndex3D); for(unsigned int i=0; i intersection; + BoostPolygonDeque intersection; boost::geometry::intersection(voxelPolygon, contour, intersection); polygonDeque.insert(polygonDeque.end(), intersection.begin(), intersection.end()); } return polygonDeque; } /*Calculate the intersection area*/ double BoostMask::calcArea(std::deque aPolygonDeque){ double area = 0; for(unsigned int i=0; iconvert(aMaskVoxel.getVoxelGridID(), gridIndex3D); return gridIndex3D; } BoostMask::MaskVoxelListPointer BoostMask::getRelevantVoxelVector(){ + calcMask(); return _voxelInStructure; } BoostMask::BoostRing2D BoostMask::convert(const rttb::PolygonType& aRTTBPolygon){ BoostMask::BoostRing2D polygon2D; BoostPoint2D firstPoint; for(unsigned int i=0; i BoostMask::getIntersectionSlicePolygons(const rttb::VoxelGridIndex3D& aVoxelGrid3D){ - std::vector boostPolygonVector; + BoostMask::BoostRingVector BoostMask::getIntersectionSlicePolygons(const rttb::VoxelGridIndex3D& aVoxelGrid3D){ + BoostRingVector boostPolygonVector; rttb::PolygonSequenceType polygonSequence = _structure->getStructureVector(); for(unsigned int i=0; i0){ double polygonZCoor = rttbPolygon.at(0)[2]; rttb::WorldCoordinate3D polygonPoint(0,0, polygonZCoor); rttb::VoxelGridIndex3D polygonPointIndex3D; _geometricInfo->worldCoordinateToIndex(polygonPoint, polygonPointIndex3D); //if the z if(aVoxelGrid3D[2] == polygonPointIndex3D[2]){ boostPolygonVector.push_back(convert(rttbPolygon)); } } } return boostPolygonVector; } BoostMask::BoostRing2D BoostMask::get2DContour(const rttb::VoxelGridIndex3D& aVoxelGrid3D){ BoostMask::BoostRing2D polygon; rttb::WorldCoordinate3D rttbPoint; _geometricInfo->indexToWorldCoordinate(aVoxelGrid3D, rttbPoint); BoostPoint2D point1 (rttbPoint[0], rttbPoint[1]); boost::geometry::append(polygon, point1); double xSpacing = _geometricInfo->getSpacing()[0]; double ySpacing = _geometricInfo->getSpacing()[1]; BoostPoint2D point2(rttbPoint[0]+xSpacing, rttbPoint[1]); boost::geometry::append(polygon, point2); BoostPoint2D point3(rttbPoint[0]+xSpacing, rttbPoint[1]+ySpacing); boost::geometry::append(polygon, point3); BoostPoint2D point4(rttbPoint[0], rttbPoint[1]+ySpacing); boost::geometry::append(polygon, point4); boost::geometry::append(polygon, point1); return polygon; } } } \ No newline at end of file diff --git a/code/masks/rttbBoostMask.h b/code/masks/rttbBoostMask.h index 81ceb34..c0996cb 100644 --- a/code/masks/rttbBoostMask.h +++ b/code/masks/rttbBoostMask.h @@ -1,96 +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. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 707 $ (last changed revision) // @date $Date: 2014-09-04 16:37:24 +0200 (Do, 04 Sep 2014) $ (last change date) // @author $Author: floca $ (last changed by) */ #ifndef __RT_BOOST_MASK_H #define __RT_BOOST_MASK_H #include "rttbBaseType.h" #include "rttbStructure.h" #include "rttbGeometricInfo.h" #include "rttbMaskVoxel.h" #include "rttbMaskAccessorInterface.h" #include #include #include #include namespace rttb{ namespace masks{ class BoostMask{ public: - typedef boost::shared_ptr GeometricInfoPtr; - typedef core::Structure::StructTypePointer StrPtr; + typedef boost::shared_ptr GeometricInfoPointer; + typedef core::Structure::StructTypePointer StructPointer; typedef core::MaskAccessorInterface::MaskVoxelList MaskVoxelList; typedef core::MaskAccessorInterface::MaskVoxelListPointer MaskVoxelListPointer; - typedef boost::geometry::model::d2::point_xy BoostPoint2D; - typedef boost::geometry::model::polygon > BoostPolygon2D; - typedef boost::geometry::model::ring > BoostRing2D; - - BoostMask(GeometricInfoPtr aDoseGeoInfo, StrPtr aStructure); - + + /*! @brief Constructor + * @exception rttb::core::NullPointerException thrown if aDoseGeoInfo or aStructure is NULL + */ + BoostMask(GeometricInfoPointer aDoseGeoInfo, StructPointer aStructure); + + /*! @brief Generate mask and return the voxels in the mask + * @exception rttb::core::InvalidParameterException thrown if the structure has self intersections + */ MaskVoxelListPointer getRelevantVoxelVector(); private: + typedef boost::geometry::model::d2::point_xy BoostPoint2D; + typedef boost::geometry::model::polygon > BoostPolygon2D; + typedef boost::geometry::model::ring > BoostRing2D; + typedef std::deque BoostPolygonDeque; + typedef std::vector BoostRingVector; + typedef std::vector VoxelIndexVector; - GeometricInfoPtr _geometricInfo; + GeometricInfoPointer _geometricInfo; - StrPtr _structure; + StructPointer _structure; //vector of the MaskVoxel inside the structure MaskVoxelListPointer _voxelInStructure; - /* Check if the structure has self intersections*/ - bool hasSelfIntersections(); - - - /*Get the min/max voxel index of the bounding box of the polygon in the slice with sliceNumber*/ - std::vector getBoundingBox(unsigned int sliceNumber); + /*! @brief Voxelization and generate mask + */ + void calcMask(); + /*! @brief Check if the structure has self intersections*/ + bool hasSelfIntersections(); - /*Get intersection polygons of the contour and a voxel polygon*/ - std::deque getIntersections(const rttb::VoxelGridIndex3D& aVoxelIndex3D); + /*! @brief Get the min/max voxel index of the bounding box of the polygon in the slice with sliceNumber*/ + VoxelIndexVector getBoundingBox(unsigned int sliceNumber); + /*! @brief Get intersection polygons of the contour and a voxel polygon*/ + BoostPolygonDeque getIntersections(const rttb::VoxelGridIndex3D& aVoxelIndex3D); - /*Calculate the intersection area*/ - double calcArea(std::deque aPolygonDeque); + /*! @brief Calculate the intersection area*/ + double calcArea(BoostPolygonDeque aPolygonDeque); + /*! @brief Get grid index of a mask voxel*/ VoxelGridIndex3D getGridIndex3D(const core::MaskVoxel& aMaskVoxel); - - /*Convert RTTB polygon to boost polygon*/ + /*! @brief Convert RTTB polygon to boost polygon*/ BoostRing2D convert(const rttb::PolygonType& aRTTBPolygon); - /*Get the intersection slice of the voxel, return the polygons in the slice*/ - std::vector getIntersectionSlicePolygons(const rttb::VoxelGridIndex3D& aVoxelGrid3D); + /*! @brief Get the intersection slice of the voxel, return the polygons in the slice*/ + BoostRingVector getIntersectionSlicePolygons(const rttb::VoxelGridIndex3D& aVoxelGrid3D); - /*Get the voxel 2d contour polygon*/ + /*! @brief Get the voxel 2d contour polygon*/ BoostRing2D get2DContour(const rttb::VoxelGridIndex3D& aVoxelGrid3D); }; } } #endif \ No newline at end of file diff --git a/code/masks/rttbBoostMaskAccessor.cpp b/code/masks/rttbBoostMaskAccessor.cpp index 96d9f75..64be0e1 100644 --- a/code/masks/rttbBoostMaskAccessor.cpp +++ b/code/masks/rttbBoostMaskAccessor.cpp @@ -1,163 +1,160 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 484 $ (last changed revision) // @date $Date: 2014-03-26 16:16:16 +0100 (Mi, 26 Mrz 2014) $ (last change date) // @author $Author: zhangl $ (last changed by) */ #include "rttbBoostMaskAccessor.h" #include "rttbBoostMask.h" -#include "rttbMappingOutsideOfImageException.h" #include #include #include #include namespace rttb { namespace masks { - BoostMaskAccessor::BoostMaskAccessor(StructTypePointer aStructurePointer, GeometricInfoPtr aGeometricInfoPtr) + BoostMaskAccessor::BoostMaskAccessor(StructTypePointer aStructurePointer, GeometricInfoPointer aGeometricInfoPtr) : _spStructure(aStructurePointer), _spGeoInfo(aGeometricInfoPtr) { _spRelevantVoxelVector = MaskVoxelListPointer(); //generate new structure set uid boost::uuids::uuid id; boost::uuids::random_generator generator; id = generator(); std::stringstream ss; ss << id; _maskUID = "BoostMask_" + ss.str(); } BoostMaskAccessor::~BoostMaskAccessor() { }; void BoostMaskAccessor::updateMask() { MaskVoxelList newRelevantVoxelVector; if (_spRelevantVoxelVector) { return; // already calculated } BoostMask mask(_spGeoInfo , _spStructure); _spRelevantVoxelVector = mask.getRelevantVoxelVector(); return; } BoostMaskAccessor::MaskVoxelListPointer BoostMaskAccessor::getRelevantVoxelVector() { // if not already generated start voxelization here updateMask(); return _spRelevantVoxelVector; } BoostMaskAccessor::MaskVoxelListPointer BoostMaskAccessor::getRelevantVoxelVector(float lowerThreshold) { MaskVoxelListPointer filteredVoxelVectorPointer(new MaskVoxelList); updateMask(); // filter relevant voxels BoostMaskAccessor::MaskVoxelList::iterator it = _spRelevantVoxelVector->begin(); while (it != _spRelevantVoxelVector->end()) { if ((*it).getRelevantVolumeFraction() > lowerThreshold) { filteredVoxelVectorPointer->push_back(*it); } ++it; } // if mask calculation was not successful this is empty! return filteredVoxelVectorPointer; } bool BoostMaskAccessor::getMaskAt(VoxelGridID aID, core::MaskVoxel& voxel) const { //initialize return voxel voxel.setRelevantVolumeFraction(0); //check if ID is valid if (!_spGeoInfo->validID(aID)) { return false; } //determine how a given voxel on the dose grid is masked if (_spRelevantVoxelVector) { BoostMaskAccessor::MaskVoxelList::iterator it = _spRelevantVoxelVector->begin(); while (it != _spRelevantVoxelVector->end()) { if ((*it).getVoxelGridID() == aID) { voxel = (*it); return true; } ++it; } - //aID is not in mask - voxel.setRelevantVolumeFraction(0); } // returns false if mask was not calculated without triggering calculation (otherwise not const!) else { return false; } return false; } bool BoostMaskAccessor::getMaskAt(const VoxelGridIndex3D& aIndex, core::MaskVoxel& voxel) const { //convert VoxelGridIndex3D to VoxelGridID VoxelGridID aVoxelGridID; if (_spGeoInfo->convert(aIndex, aVoxelGridID)) { return getMaskAt(aVoxelGridID, voxel); } else { return false; } } const core::GeometricInfo& BoostMaskAccessor::getGeometricInfo() const { return *_spGeoInfo; }; } } \ No newline at end of file diff --git a/code/masks/rttbBoostMaskAccessor.h b/code/masks/rttbBoostMaskAccessor.h index af67e73..2497a48 100644 --- a/code/masks/rttbBoostMaskAccessor.h +++ b/code/masks/rttbBoostMaskAccessor.h @@ -1,110 +1,117 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 484 $ (last changed revision) // @date $Date: 2014-03-26 16:16:16 +0100 (Mi, 26 Mrz 2014) $ (last change date) // @author $Author: zhangl $ (last changed by) */ #ifndef __BOOST_MASK_ACCESSOR__H #define __BOOST_MASK_ACCESSOR__H #include "rttbBaseType.h" #include "rttbGeometricInfo.h" #include "rttbMaskVoxel.h" -#include "rttbBoostMask.h" #include "rttbMaskAccessorInterface.h" #include "rttbGenericDoseIterator.h" #include "rttbStructure.h" #include namespace rttb { namespace masks { - /*! @class OTBMaskAccessor - * @brief Implementation of original toolbox voxelization by M. Hub. + /*! @class BoostMaskAccessor + * @brief Implementation of the voxelization using boost */ class BoostMaskAccessor: public core::MaskAccessorInterface { public: typedef core::MaskAccessorInterface::MaskVoxelList MaskVoxelList; typedef core::MaskAccessorInterface::MaskVoxelListPointer MaskVoxelListPointer; typedef core::Structure::StructTypePointer StructTypePointer; - typedef boost::shared_ptr GeometricInfoPtr; + typedef boost::shared_ptr GeometricInfoPointer; private: - GeometricInfoPtr _spGeoInfo; + GeometricInfoPointer _spGeoInfo; /*! vector containing list of mask voxels*/ MaskVoxelListPointer _spRelevantVoxelVector; StructTypePointer _spStructure; IDType _maskUID; public: - ~BoostMaskAccessor(); + + /*! @brief constructor with a structure pointer and a geometric info pointer + * @param aStructurePointer smart pointer of the structure + * @param aGeometricInfoPtr smart pointer of the geometricinfo of the dose + */ + BoostMaskAccessor(StructTypePointer aStructurePointer, GeometricInfoPointer aGeometricInfoPtr); - // import of structure sets (loading from data) is done elsewhere. Structures are only voxelized here. - // here the original RTToolbox voxelization shall be implemented - BoostMaskAccessor(StructTypePointer aStructurePointer, GeometricInfoPtr aGeometricInfoPtr); + /*! @brief destructor*/ + ~BoostMaskAccessor(); - /*! @brief voxelization of the given structures according to the original RTToolbox algorithm*/ + /*! @brief voxelization of the given structures using boost algorithms*/ void updateMask(); - /*! @brief get vector conatining al relevant voxels that are inside the given structure*/ + /*! @brief get vector containing all relevant voxels that are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector(); - /*! @brief get vector conatining al relevant voxels that have a relevant volume above the given threshold and are inside the given structure*/ + + /*! @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); /*!@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 containes 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 containes valid values.*/ + * @return Indicates of the voxel exists and therefore if parameter voxel containes valid values.*/ bool getMaskAt(const VoxelGridID aID, core::MaskVoxel& voxel) const; + /*!@brief determine how a given voxel on the dose grid is masked + * @param aIndex 3d index of the voxel in grid. + * @param voxel Reference to the voxel. + * @return Indicates of the voxel exists and therefore if parameter voxel containes valid values.*/ bool getMaskAt(const VoxelGridIndex3D& aIndex, core::MaskVoxel& voxel) const; /*! @brief give access to GeometricInfo*/ const core::GeometricInfo& getGeometricInfo() const; - /* @ 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. + /* @ brief is true if dose is on a homogeneous grid + * @remark 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 { return true; }; IDType getMaskUID() const { return _maskUID; }; }; } } #endif