comparison Applications/StoneWebViewer/WebApplication/app.js @ 1862:63587fdeec69

added 'SkipSeriesFromModalities' to ignore series from modality types
author Alain Mazy <am@osimis.io>
date Thu, 23 Sep 2021 14:38:42 +0200
parents 9290d2916150
children 3889ae96d2e9
comparison
equal deleted inserted replaced
1861:9290d2916150 1862:63587fdeec69
31 var PATIENT_NAME = '0010,0010'; 31 var PATIENT_NAME = '0010,0010';
32 var SERIES_NUMBER = '0020,0011'; 32 var SERIES_NUMBER = '0020,0011';
33 var SERIES_DESCRIPTION = '0008,103e'; 33 var SERIES_DESCRIPTION = '0008,103e';
34 var MODALITY = '0008,0060'; 34 var MODALITY = '0008,0060';
35 var PATIENT_BIRTH_DATE = '0010,0030'; 35 var PATIENT_BIRTH_DATE = '0010,0030';
36 var NON_DISPLAYABLE_MODALITIES = ['PR', 'SR']
37 36
38 // Registry of the PDF series for which the instance metadata is still waiting 37 // Registry of the PDF series for which the instance metadata is still waiting
39 var pendingSeriesPdf_ = {}; 38 var pendingSeriesPdf_ = {};
40 39
41 var MOUSE_TOOL_COMBINED = 1; 40 var MOUSE_TOOL_COMBINED = 1;
569 var posColor = 0; 568 var posColor = 0;
570 569
571 // order series by SeriesNumber 570 // order series by SeriesNumber
572 sourceSeries.sort((a, b) => {return a[SERIES_NUMBER] - b[SERIES_NUMBER];}) 571 sourceSeries.sort((a, b) => {return a[SERIES_NUMBER] - b[SERIES_NUMBER];})
573 572
574 // discard non displayable series
575 sourceSeries = sourceSeries.filter((s) => {return NON_DISPLAYABLE_MODALITIES.indexOf(s[MODALITY]) == -1; } )
576
577 for (var i = 0; i < sourceStudies.length; i++) { 573 for (var i = 0; i < sourceStudies.length; i++) {
578 var studyInstanceUid = sourceStudies[i][STUDY_INSTANCE_UID]; 574 var studyInstanceUid = sourceStudies[i][STUDY_INSTANCE_UID];
579 if (studyInstanceUid !== undefined) { 575 if (studyInstanceUid !== undefined) {
580 if (studyInstanceUid in indexStudies) { 576 if (studyInstanceUid in indexStudies) {
581 console.error('Twice the same study: ' + studyInstanceUid); 577 console.error('Twice the same study: ' + studyInstanceUid);
1145 1141
1146 if ('DicomCacheSize' in app.globalConfiguration) { 1142 if ('DicomCacheSize' in app.globalConfiguration) {
1147 stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize); 1143 stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize);
1148 } 1144 }
1149 1145
1146 if ('SkipSeriesFromModalities' in app.globalConfiguration) {
1147 stone.SetSkipSeriesFromModalities(JSON.stringify(app.globalConfiguration.SkipSeriesFromModalities));
1148 }
1149
1150 // Bearer token is new in Stone Web viewer 2.0 1150 // Bearer token is new in Stone Web viewer 2.0
1151 var token = getParameterFromUrl('token'); 1151 var token = getParameterFromUrl('token');
1152 if (token !== undefined) 1152 if (token !== undefined)
1153 { 1153 {
1154 stone.AddHttpHeader('Authorization', 'Bearer ' + token); 1154 stone.AddHttpHeader('Authorization', 'Bearer ' + token);
1209 } 1209 }
1210 }); 1210 });
1211 1211
1212 1212
1213 window.addEventListener('ResourcesLoaded', function() { 1213 window.addEventListener('ResourcesLoaded', function() {
1214 console.log('resources loaded'); 1214 console.log('resources loaded: ', stone.GetStudiesCount(), 'studies &', stone.GetSeriesCount(), 'series');
1215 1215
1216 var studies = []; 1216 var studies = [];
1217 for (var i = 0; i < stone.GetStudiesCount(); i++) { 1217 for (var i = 0; i < stone.GetStudiesCount(); i++) {
1218 stone.LoadStudyTags(i); 1218 stone.LoadStudyTags(i);
1219 studies.push(JSON.parse(stone.GetStringBuffer())); 1219 studies.push(JSON.parse(stone.GetStringBuffer()));