comparison 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
comparison
equal deleted inserted replaced
1995:f2a094fa8c33 1996:6e4ef6e3b2bf
443 modalPreferences: false, 443 modalPreferences: false,
444 444
445 // User preferences (stored in the local storage) 445 // User preferences (stored in the local storage)
446 settingNotDiagnostic: true, 446 settingNotDiagnostic: true,
447 settingSoftwareRendering: false, 447 settingSoftwareRendering: false,
448 settingLinearInterpolation: true,
448 449
449 layoutCountX: 1, 450 layoutCountX: 1,
450 layoutCountY: 1, 451 layoutCountY: 1,
451 452
452 viewport1Width: '100%', 453 viewport1Width: '100%',
521 settingNotDiagnostic: function(newVal, oldVal) { 522 settingNotDiagnostic: function(newVal, oldVal) {
522 localStorage.settingNotDiagnostic = (newVal ? '1' : '0'); 523 localStorage.settingNotDiagnostic = (newVal ? '1' : '0');
523 }, 524 },
524 settingSoftwareRendering: function(newVal, oldVal) { 525 settingSoftwareRendering: function(newVal, oldVal) {
525 localStorage.settingSoftwareRendering = (newVal ? '1' : '0'); 526 localStorage.settingSoftwareRendering = (newVal ? '1' : '0');
527 },
528 settingLinearInterpolation: function(newVal, oldVal) {
529 localStorage.settingLinearInterpolation = (newVal ? '1' : '0');
526 } 530 }
527 }, 531 },
528 methods: { 532 methods: {
529 FitContent: function() { 533 FitContent: function() {
530 // This function can be used even if WebAssembly is not initialized yet 534 // This function can be used even if WebAssembly is not initialized yet
917 } 921 }
918 }, 922 },
919 923
920 ApplyPreferences: function() { 924 ApplyPreferences: function() {
921 this.modalPreferences = false; 925 this.modalPreferences = false;
926
927 stone.SetLinearInterpolation(localStorage.settingLinearInterpolation);
922 928
923 if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) { 929 if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) {
924 document.location.reload(); 930 document.location.reload();
925 } 931 }
926 }, 932 },
1139 1145
1140 } 1146 }
1141 }, 1147 },
1142 1148
1143 mounted: function() { 1149 mounted: function() {
1150 // Warning: In this function, the "stone" global object is not initialized yet!
1151
1144 this.SetViewportLayout('1x1'); 1152 this.SetViewportLayout('1x1');
1145 1153
1146 if (localStorage.settingNotDiagnostic) { 1154 if (localStorage.settingNotDiagnostic) {
1147 this.settingNotDiagnostic = (localStorage.settingNotDiagnostic == '1'); 1155 this.settingNotDiagnostic = (localStorage.settingNotDiagnostic == '1');
1148 } 1156 }
1149 1157
1150 if (localStorage.settingSoftwareRendering) { 1158 if (localStorage.settingSoftwareRendering) {
1151 this.settingSoftwareRendering = (localStorage.settingSoftwareRendering == '1'); 1159 this.settingSoftwareRendering = (localStorage.settingSoftwareRendering == '1');
1160 }
1161
1162 if (localStorage.settingLinearInterpolation) {
1163 this.settingLinearInterpolation = (localStorage.settingLinearInterpolation == '1');
1152 } 1164 }
1153 1165
1154 var that = this; 1166 var that = this;
1155 1167
1156 window.addEventListener('VirtualSeriesThumbnailLoaded', function(args) { 1168 window.addEventListener('VirtualSeriesThumbnailLoaded', function(args) {
1188 **/ 1200 **/
1189 1201
1190 stone.Setup(Module); 1202 stone.Setup(Module);
1191 stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot, 1203 stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot,
1192 true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */); 1204 true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */);
1193 stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); 1205 stone.SetSoftwareRendering(app.settingSoftwareRendering);
1206 stone.SetLinearInterpolation(app.settingLinearInterpolation);
1194 1207
1195 if ('DicomCacheSize' in app.globalConfiguration) { 1208 if ('DicomCacheSize' in app.globalConfiguration) {
1196 stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize); 1209 stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize);
1197 } 1210 }
1198 1211