Mercurial > hg > orthanc-wsi
changeset 511:469cb17be6aa
support DICOM-ization of tiled TIFF with no compression
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Wed, 19 Aug 2026 18:21:21 +0200 |
| parents | ea451645a59e |
| children | 8e1efa410312 |
| files | Framework/Algorithms/PyramidReader.cpp Framework/Algorithms/PyramidReader.h Framework/Outputs/InMemoryTiledImage.cpp NEWS |
| diffstat | 4 files changed, 32 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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<Orthanc::ImageAccessor> decoded(ImageToolbox::DecodeTile(tile, compression)); + std::unique_ptr<Orthanc::ImageAccessor> decoded(DecodeRawTile(tile, compression)); CheckTileSize(*decoded); } }
--- 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<Orthanc::ImageAccessor> outside_; + Orthanc::ImageAccessor* DecodeRawTile(const std::string& tile, + ImageCompression compression) const; + Orthanc::ImageAccessor& GetOutsideTile(); void CheckTileSize(const Orthanc::ImageAccessor& tile) const;
--- 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<Orthanc::ImageAccessor> decoded(ImageToolbox::DecodeTile(raw, compression)); + std::unique_ptr<Orthanc::ImageAccessor> 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); }
--- 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"
