# HG changeset patch # User Sebastien Jodogne # Date 1787150250 -7200 # Node ID f8cd1ddb777c140c4c27f48b9b1fd9cce304d6ba # Parent 1ff28917472650a5edf55b25758f38fa359869b4 added abstraction ITiledPyramid::GetBackgroundColor() diff -r 1ff289174726 -r f8cd1ddb777c Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Mon Aug 10 09:41:52 2026 +0200 +++ b/Applications/Dicomizer.cpp Wed Aug 19 16:37:30 2026 +0200 @@ -181,7 +181,7 @@ if (lowerLevelsCount != levelsCount) { LOG(WARNING) << "Constructing the " << lowerLevelsCount << " lower levels of the pyramid"; - OrthancWSI::TruncatedPyramidWriter truncated(target, lowerLevelsCount, source.GetPhotometricInterpretation()); + OrthancWSI::TruncatedPyramidWriter truncated(target, lowerLevelsCount, source.GetPhotometricInterpretation(), source.GetBackgroundColor()); OrthancWSI::ReconstructPyramidCommand::PrepareBagOfTasks (tasks, truncated, source, lowerLevelsCount + 1, 0, parameters); OrthancWSI::ApplicationToolbox::Execute(tasks, parameters.GetThreadsCount()); diff -r 1ff289174726 -r f8cd1ddb777c Framework/Inputs/DecodedTiledPyramid.h --- a/Framework/Inputs/DecodedTiledPyramid.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Inputs/DecodedTiledPyramid.h Wed Aug 19 16:37:30 2026 +0200 @@ -57,7 +57,7 @@ backgroundColor_.SetValue(red, green, blue); } - const BackgroundColor& GetBackgroundColor() const + virtual BackgroundColor GetBackgroundColor() const ORTHANC_OVERRIDE { return backgroundColor_; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Inputs/DicomPyramid.h --- a/Framework/Inputs/DicomPyramid.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Inputs/DicomPyramid.h Wed Aug 19 16:37:30 2026 +0200 @@ -87,7 +87,7 @@ virtual Orthanc::PhotometricInterpretation GetPhotometricInterpretation() const ORTHANC_OVERRIDE; - const BackgroundColor& GetBackgroundColor() const + virtual BackgroundColor GetBackgroundColor() const ORTHANC_OVERRIDE { return backgroundColor_; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Inputs/HierarchicalTiff.h --- a/Framework/Inputs/HierarchicalTiff.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Inputs/HierarchicalTiff.h Wed Aug 19 16:37:30 2026 +0200 @@ -106,5 +106,10 @@ bool LookupImagedVolumeSize(double& width, double& height) const; + + virtual BackgroundColor GetBackgroundColor() const ORTHANC_OVERRIDE + { + return BackgroundColor(); // No background color + } }; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Inputs/ITiledPyramid.h --- a/Framework/Inputs/ITiledPyramid.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Inputs/ITiledPyramid.h Wed Aug 19 16:37:30 2026 +0200 @@ -23,6 +23,7 @@ #pragma once +#include "../BackgroundColor.h" #include "../Enumerations.h" #include @@ -69,5 +70,7 @@ virtual Orthanc::PixelFormat GetPixelFormat() const = 0; virtual Orthanc::PhotometricInterpretation GetPhotometricInterpretation() const = 0; + + virtual BackgroundColor GetBackgroundColor() const = 0; }; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Inputs/TiledPyramidStatistics.h --- a/Framework/Inputs/TiledPyramidStatistics.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Inputs/TiledPyramidStatistics.h Wed Aug 19 16:37:30 2026 +0200 @@ -87,5 +87,10 @@ { return source_.GetPhotometricInterpretation(); } + + virtual BackgroundColor GetBackgroundColor() const ORTHANC_OVERRIDE + { + return source_.GetBackgroundColor(); + } }; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Outputs/InMemoryTiledImage.cpp --- a/Framework/Outputs/InMemoryTiledImage.cpp Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Outputs/InMemoryTiledImage.cpp Wed Aug 19 16:37:30 2026 +0200 @@ -48,13 +48,15 @@ unsigned int countTilesY, unsigned int tileWidth, unsigned int tileHeight, - Orthanc::PhotometricInterpretation photometric) : + Orthanc::PhotometricInterpretation photometric, + BackgroundColor backgroundColor) : format_(format), countTilesX_(countTilesX), countTilesY_(countTilesY), tileWidth_(tileWidth), tileHeight_(tileHeight), - photometric_(photometric) + photometric_(photometric), + backgroundColor_(backgroundColor) { } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Outputs/InMemoryTiledImage.h --- a/Framework/Outputs/InMemoryTiledImage.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Outputs/InMemoryTiledImage.h Wed Aug 19 16:37:30 2026 +0200 @@ -47,6 +47,7 @@ unsigned int tileHeight_; Tiles tiles_; Orthanc::PhotometricInterpretation photometric_; + BackgroundColor backgroundColor_; public: InMemoryTiledImage(Orthanc::PixelFormat format, @@ -54,7 +55,8 @@ unsigned int countTilesY, unsigned int tileWidth, unsigned int tileHeight, - Orthanc::PhotometricInterpretation photometric); + Orthanc::PhotometricInterpretation photometric, + BackgroundColor backgroundColor); virtual ~InMemoryTiledImage(); @@ -124,5 +126,10 @@ { return photometric_; } + + virtual BackgroundColor GetBackgroundColor() const ORTHANC_OVERRIDE + { + return backgroundColor_; + } }; } diff -r 1ff289174726 -r f8cd1ddb777c Framework/Outputs/TruncatedPyramidWriter.cpp --- a/Framework/Outputs/TruncatedPyramidWriter.cpp Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Outputs/TruncatedPyramidWriter.cpp Wed Aug 19 16:37:30 2026 +0200 @@ -30,14 +30,16 @@ { TruncatedPyramidWriter::TruncatedPyramidWriter(IPyramidWriter& lower, unsigned int upperLevelIndex, - Orthanc::PhotometricInterpretation photometric) : + Orthanc::PhotometricInterpretation photometric, + const BackgroundColor& backgroundColor) : lowerLevels_(lower), upperLevel_(lower.GetPixelFormat(), lower.GetCountTilesX(upperLevelIndex), lower.GetCountTilesY(upperLevelIndex), lower.GetTileWidth(), lower.GetTileHeight(), - photometric), + photometric, + backgroundColor), upperLevelIndex_(upperLevelIndex) { if (upperLevelIndex > lower.GetLevelCount()) diff -r 1ff289174726 -r f8cd1ddb777c Framework/Outputs/TruncatedPyramidWriter.h --- a/Framework/Outputs/TruncatedPyramidWriter.h Mon Aug 10 09:41:52 2026 +0200 +++ b/Framework/Outputs/TruncatedPyramidWriter.h Wed Aug 19 16:37:30 2026 +0200 @@ -37,7 +37,8 @@ public: TruncatedPyramidWriter(IPyramidWriter& lower, unsigned int upperLevelIndex, - Orthanc::PhotometricInterpretation photometric); + Orthanc::PhotometricInterpretation photometric, + const BackgroundColor& backgroundColor); virtual unsigned int GetLevelCount() const ORTHANC_OVERRIDE {