diff Applications/StoneWebViewer/WebApplication/app.js @ 1996:6e4ef6e3b2bf

linear interpolation of images can be turned off in the user preferences
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Nov 2022 19:41:03 +0100
parents 317a53d4fdc6
children 1fa3f484008e
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Tue Nov 01 19:04:34 2022 +0100
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Tue Nov 01 19:41:03 2022 +0100
@@ -445,6 +445,7 @@
       // User preferences (stored in the local storage)
       settingNotDiagnostic: true,
       settingSoftwareRendering: false,
+      settingLinearInterpolation: true,
 
       layoutCountX: 1,
       layoutCountY: 1,
@@ -523,6 +524,9 @@
     },
     settingSoftwareRendering: function(newVal, oldVal) {
       localStorage.settingSoftwareRendering = (newVal ? '1' : '0');
+    },
+    settingLinearInterpolation: function(newVal, oldVal) {
+      localStorage.settingLinearInterpolation = (newVal ? '1' : '0');
     }
   },
   methods: {
@@ -920,6 +924,8 @@
     ApplyPreferences: function() {
       this.modalPreferences = false;
 
+      stone.SetLinearInterpolation(localStorage.settingLinearInterpolation);
+
       if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) {
         document.location.reload();
       }
@@ -1141,6 +1147,8 @@
   },
   
   mounted: function() {
+    // Warning: In this function, the "stone" global object is not initialized yet!
+    
     this.SetViewportLayout('1x1');
 
     if (localStorage.settingNotDiagnostic) {
@@ -1151,6 +1159,10 @@
       this.settingSoftwareRendering = (localStorage.settingSoftwareRendering == '1');
     }
 
+    if (localStorage.settingLinearInterpolation) {
+      this.settingLinearInterpolation = (localStorage.settingLinearInterpolation == '1');
+    }
+
     var that = this;
     
     window.addEventListener('VirtualSeriesThumbnailLoaded', function(args) {
@@ -1190,7 +1202,8 @@
   stone.Setup(Module);
   stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot,
                         true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */);
-  stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1');
+  stone.SetSoftwareRendering(app.settingSoftwareRendering);
+  stone.SetLinearInterpolation(app.settingLinearInterpolation);
 
   if ('DicomCacheSize' in app.globalConfiguration) {
     stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize);