# HG changeset patch # User Sebastien Jodogne # Date 1787156481 -7200 # Node ID 469cb17be6aaafd8055429fb38706232faad211a # Parent ea451645a59e0a89d04914101fe6002f2fe9e61d support DICOM-ization of tiled TIFF with no compression diff -r ea451645a59e -r 469cb17be6aa Framework/Algorithms/PyramidReader.cpp --- a/Framework/Algorithms/PyramidReader.cpp Wed Aug 19 17:52:56 2026 +0200 +++ b/Framework/Algorithms/PyramidReader.cpp Wed Aug 19 18:21:21 2026 +0200 @@ -151,7 +151,8 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - decoded_.reset(ImageToolbox::DecodeTile(rawTile_, rawTileCompression_)); + decoded_.reset(that_.DecodeRawTile(rawTile_, rawTileCompression_)); + if (decoded_.get() == NULL) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); @@ -170,6 +171,20 @@ }; + Orthanc::ImageAccessor* PyramidReader::DecodeRawTile(const std::string& tile, + ImageCompression compression) const + { + if (compression == ImageCompression_None) + { + return ImageToolbox::DecodeRawTile(tile, source_.GetPixelFormat(), sourceTileWidth_, sourceTileHeight_); + } + else + { + return ImageToolbox::DecodeTile(tile, compression); + } + } + + Orthanc::ImageAccessor& PyramidReader::GetOutsideTile() { if (outside_.get() == NULL) @@ -199,7 +214,7 @@ { if (parameters_.IsSafetyCheck()) { - std::unique_ptr decoded(ImageToolbox::DecodeTile(tile, compression)); + std::unique_ptr decoded(DecodeRawTile(tile, compression)); CheckTileSize(*decoded); } } diff -r ea451645a59e -r 469cb17be6aa Framework/Algorithms/PyramidReader.h --- a/Framework/Algorithms/PyramidReader.h Wed Aug 19 17:52:56 2026 +0200 +++ b/Framework/Algorithms/PyramidReader.h Wed Aug 19 18:21:21 2026 +0200 @@ -57,6 +57,9 @@ std::unique_ptr outside_; + Orthanc::ImageAccessor* DecodeRawTile(const std::string& tile, + ImageCompression compression) const; + Orthanc::ImageAccessor& GetOutsideTile(); void CheckTileSize(const Orthanc::ImageAccessor& tile) const; diff -r ea451645a59e -r 469cb17be6aa Framework/Outputs/InMemoryTiledImage.cpp --- a/Framework/Outputs/InMemoryTiledImage.cpp Wed Aug 19 17:52:56 2026 +0200 +++ b/Framework/Outputs/InMemoryTiledImage.cpp Wed Aug 19 18:21:21 2026 +0200 @@ -149,7 +149,17 @@ unsigned int tileX, unsigned int tileY) { - std::unique_ptr decoded(ImageToolbox::DecodeTile(raw, compression)); + std::unique_ptr decoded; + + if (compression == ImageCompression_None) + { + decoded.reset(ImageToolbox::DecodeRawTile(raw, format_, tileWidth_, tileHeight_)); + } + else + { + decoded.reset(ImageToolbox::DecodeTile(raw, compression)); + } + EncodeTile(*decoded, level, tileX, tileY); } diff -r ea451645a59e -r 469cb17be6aa NEWS --- a/NEWS Wed Aug 19 17:52:56 2026 +0200 +++ b/NEWS Wed Aug 19 18:21:21 2026 +0200 @@ -7,6 +7,7 @@ when the "--magnification" command-line option is provided - Now adding a FrameOfReferenceUID DICOM tag. This is required, amongst others, by the measurement tools in the OHIF microscopy viewer + - Support DICOM-ization of tiled TIFF with no compression * Viewer plugin: - Added CMake option "ORTHANC_SDK_VERSION"