# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1739984065 -3600
# Node ID 71bbdc4b4790f0a6efb0551aaef5a0da76372cd5
# Parent  6fe353ea719c0316563aba2df7bc03e558600709
fix handling of "Image Type" in the viewer

diff -r 6fe353ea719c -r 71bbdc4b4790 Framework/Inputs/DicomPyramid.cpp
--- a/Framework/Inputs/DicomPyramid.cpp	Fri Jan 17 12:43:40 2025 +0100
+++ b/Framework/Inputs/DicomPyramid.cpp	Wed Feb 19 17:54:25 2025 +0100
@@ -98,10 +98,15 @@
         std::vector<std::string> tokens;
         Orthanc::Toolbox::TokenizeString(tokens, instance->GetImageType(), '\\');
 
-        // Don't consider the thumbnail and overview as part of the DICOM pyramid (new in 1.0)
-        if (tokens.size() < 2 ||
-            (tokens[1] != "THUMBNAIL" &&
-             tokens[1] != "OVERVIEW"))
+        /**
+         * Don't consider the "LABEL" and "OVERVIEW" that are not part
+         * of the pyramid. Originally introduced in release 1.0, but
+         * fixed in release 3.1.
+         * https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.12.4.html#sect_C.8.12.4.1.1
+         **/
+        if (tokens.size() < 3 ||
+            tokens[2] == "VOLUME" ||
+            tokens[2] == "THUMBNAIL" /* "may be the apex (lowest resolution) layer of a Multi-Resolution Pyramid" */)
         {
           if (instance->HasBackgroundColor())
           {
diff -r 6fe353ea719c -r 71bbdc4b4790 NEWS
--- a/NEWS	Fri Jan 17 12:43:40 2025 +0100
+++ b/NEWS	Wed Feb 19 17:54:25 2025 +0100
@@ -1,6 +1,8 @@
 Pending changes in the mainline
 ===============================
 
+* Fix handling of "Image Type" in the viewer for compatibility with other vendors
+
 
 Version 3.0 (2024-12-20)
 ========================