Mercurial > hg > orthanc-wsi
changeset 427:f80f2d8a21e8
replaced boost::math::iround() by Orthanc::Math::iround()
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 27 Jan 2026 17:26:25 +0100 |
| parents | e5cdb66800f8 |
| children | 37d2459e3516 |
| files | Applications/Dicomizer.cpp Framework/ColorSpaces.cpp Framework/Inputs/OpenSlidePyramid.cpp ViewerPlugin/IIIF.cpp |
| diffstat | 4 files changed, 14 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Dicomizer.cpp Tue Jan 06 10:51:37 2026 +0100 +++ b/Applications/Dicomizer.cpp Tue Jan 27 17:26:25 2026 +0100 @@ -55,8 +55,6 @@ #include <dcmtk/dcmdata/dcvrobow.h> #include <dcmtk/dcmdata/dcvrat.h> -#include <boost/math/special_functions/round.hpp> - static const char* OPTION_COLOR = "color"; static const char* OPTION_COMPRESSION = "compression";
--- a/Framework/ColorSpaces.cpp Tue Jan 06 10:51:37 2026 +0100 +++ b/Framework/ColorSpaces.cpp Tue Jan 27 17:26:25 2026 +0100 @@ -23,11 +23,10 @@ #include "ColorSpaces.h" +#include <CompatibilityMath.h> #include <SerializationToolbox.h> #include <Toolbox.h> -#include <boost/math/special_functions/round.hpp> - namespace OrthancWSI { @@ -43,7 +42,7 @@ } else { - r_ = boost::math::iround(srgb.GetR() * 255.0f); + r_ = Orthanc::Math::iround(srgb.GetR() * 255.0f); } if (srgb.GetG() < 0) @@ -56,7 +55,7 @@ } else { - g_ = boost::math::iround(srgb.GetG() * 255.0f); + g_ = Orthanc::Math::iround(srgb.GetG() * 255.0f); } if (srgb.GetB() < 0) @@ -69,7 +68,7 @@ } else { - b_ = boost::math::iround(srgb.GetB() * 255.0f); + b_ = Orthanc::Math::iround(srgb.GetB() * 255.0f); } } @@ -213,7 +212,7 @@ { float lambda = (value - minValue) / (maxValue - minValue); assert(lambda >= 0 && lambda <= 1); - return static_cast<uint16_t>(boost::math::iround(lambda * static_cast<float>(0xffff))); + return static_cast<uint16_t>(Orthanc::Math::iround(lambda * static_cast<float>(0xffff))); } }
--- a/Framework/Inputs/OpenSlidePyramid.cpp Tue Jan 06 10:51:37 2026 +0100 +++ b/Framework/Inputs/OpenSlidePyramid.cpp Tue Jan 27 17:26:25 2026 +0100 @@ -30,7 +30,6 @@ #include <SerializationToolbox.h> #include <Logging.h> -#include <boost/math/special_functions/round.hpp> #include <memory> namespace OrthancWSI
--- a/ViewerPlugin/IIIF.cpp Tue Jan 06 10:51:37 2026 +0100 +++ b/ViewerPlugin/IIIF.cpp Tue Jan 27 17:26:25 2026 +0100 @@ -24,19 +24,17 @@ #include "../Framework/PrecompiledHeadersWSI.h" #include "IIIF.h" +#include "../Framework/Inputs/DecodedPyramidCache.h" +#include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" #include "DicomPyramidCache.h" #include "RawTile.h" -#include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" +#include <CompatibilityMath.h> #include <Images/Image.h> #include <Images/ImageProcessing.h> #include <Logging.h> #include <SerializationToolbox.h> -#include <boost/math/special_functions/round.hpp> - -#include "../Framework/Inputs/DecodedPyramidCache.h" - static const char* const ROWS = "0028,0010"; static const char* const COLUMNS = "0028,0011"; @@ -321,17 +319,17 @@ static unsigned int GetPhysicalTileWidth(const OrthancWSI::ITiledPyramid& pyramid, unsigned int level) { - return static_cast<unsigned int>(boost::math::iround(static_cast<float>(pyramid.GetTileWidth(level)) * - static_cast<float>(pyramid.GetLevelWidth(0)) / - static_cast<float>(pyramid.GetLevelWidth(level)))); + return static_cast<unsigned int>(Orthanc::Math::iround(static_cast<float>(pyramid.GetTileWidth(level)) * + static_cast<float>(pyramid.GetLevelWidth(0)) / + static_cast<float>(pyramid.GetLevelWidth(level)))); } static unsigned int GetPhysicalTileHeight(const OrthancWSI::ITiledPyramid& pyramid, unsigned int level) { - return static_cast<unsigned int>(boost::math::iround(static_cast<float>(pyramid.GetTileHeight(level)) * - static_cast<float>(pyramid.GetLevelHeight(0)) / - static_cast<float>(pyramid.GetLevelHeight(level)))); + return static_cast<unsigned int>(Orthanc::Math::iround(static_cast<float>(pyramid.GetTileHeight(level)) * + static_cast<float>(pyramid.GetLevelHeight(0)) / + static_cast<float>(pyramid.GetLevelHeight(level)))); } public:
