comparison Applications/StoneWebViewer/WebApplication/app.js @ 1714:a878e807cd96

configuration option "DicomCacheSize", warning if cache should be larger
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 30 Nov 2020 17:57:10 +0100
parents aec45e0b2528
children 65c03d33c345
comparison
equal deleted inserted replaced
1713:aec45e0b2528 1714:a878e807cd96
1021 window.addEventListener('StoneInitialized', function() { 1021 window.addEventListener('StoneInitialized', function() {
1022 stone.Setup(Module); 1022 stone.Setup(Module);
1023 stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot, 1023 stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot,
1024 true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */); 1024 true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */);
1025 stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); 1025 stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1');
1026
1027 if ('DicomCacheSize' in app.globalConfiguration) {
1028 stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize);
1029 }
1030
1026 console.warn('Stone properly initialized'); 1031 console.warn('Stone properly initialized');
1027 1032
1028 app.SetCombinedToolActions(); 1033 app.SetCombinedToolActions();
1029 1034
1030 var selectedStudies = getParameterFromUrl('selectedStudies'); 1035 var selectedStudies = getParameterFromUrl('selectedStudies');
1174 // Disable the selection of text using the mouse 1179 // Disable the selection of text using the mouse
1175 document.onselectstart = new Function ('return false'); 1180 document.onselectstart = new Function ('return false');
1176 1181
1177 1182
1178 window.addEventListener('message', function(e) { 1183 window.addEventListener('message', function(e) {
1179 if ('type' in e.data && 1184 if ('type' in e.data) {
1180 (e.data.type == 'show-osirix-annotations')) { 1185 if (e.data.type == 'show-osirix-annotations') {
1181 var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin']; 1186 var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin'];
1182
1183 if (expectedOrigin === undefined) {
1184 alert('Dynamic actions are disabled in the Stone Web viewer, ' +
1185 'set the configuration option "ExpectedMessageOrigin".');
1186 }
1187 else if (expectedOrigin != '*' &&
1188 e.origin !== expectedOrigin) {
1189 alert('Bad origin for a dynamic action in the Stone Web viewer: "' + e.origin +
1190 '", whereas the message must have origin: "' + expectedOrigin + '"');
1191 }
1192 else if (e.data.type == 'show-osirix-annotations') {
1193 var clear = true; // Whether to clear previous annotations
1194 if ('clear' in e.data) {
1195 clear = e.data.clear;
1196 }
1197 1187
1198 app.LoadOsiriXAnnotations(e.data.xml, clear); 1188 if (expectedOrigin === undefined) {
1199 } 1189 alert('Dynamic actions are disabled in the Stone Web viewer, ' +
1200 } 1190 'set the configuration option "ExpectedMessageOrigin".');
1201 else { 1191 }
1202 console.log('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type); 1192 else if (expectedOrigin != '*' &&
1193 e.origin !== expectedOrigin) {
1194 alert('Bad origin for a dynamic action in the Stone Web viewer: "' + e.origin +
1195 '", whereas the message must have origin: "' + expectedOrigin + '"');
1196 }
1197 else if (e.data.type == 'show-osirix-annotations') {
1198 var clear = true; // Whether to clear previous annotations
1199 if ('clear' in e.data) {
1200 clear = e.data.clear;
1201 }
1202
1203 app.LoadOsiriXAnnotations(e.data.xml, clear);
1204 }
1205 }
1206 else {
1207 console.log('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type);
1208 }
1203 } 1209 }
1204 }); 1210 });