changeset 2179:dd08f4f17a7a

allow different images from the same series to have different windowings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Nov 2024 14:02:04 +0100 (3 months ago)
parents 94df151039f1
children 356ae7ad47e4
files Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Wed Nov 06 16:12:21 2024 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Tue Nov 26 14:02:04 2024 +0100
@@ -2395,10 +2395,16 @@
           // (cf. mail from Tomas Kenda on 2021-08-17)
           InstancesCache::Accessor accessor(*instancesCache_, instance.GetSopInstanceUid());
           OrthancStone::Windowing windowing;
-          if (accessor.IsValid() &&
-              accessor.GetParameters().LookupPerFrameWindowing(windowing, frameIndex))
+          if (accessor.IsValid())
           {
-            UpdateWindowing(WindowingState_FramePreset, windowing);
+            if (accessor.GetParameters().LookupPerFrameWindowing(windowing, frameIndex))
+            {
+              UpdateWindowing(WindowingState_FramePreset, windowing);
+            }
+            else if (accessor.GetParameters().GetWindowingPresetsCount() > 0)
+            {
+              UpdateWindowing(WindowingState_FramePreset, accessor.GetParameters().GetWindowingPreset(0));
+            }
           }
         }