Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebApplication/app.js @ 1692:e787b52d025f
"selectedStudies" argument to replace "selectedStudyIds" from Osimis Web viewer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Nov 2020 18:11:42 +0100 |
parents | 4a49de03a419 |
children | eafb10992e73 |
comparison
equal
deleted
inserted
replaced
1691:4a49de03a419 | 1692:e787b52d025f |
---|---|
301 viewport4Series: {}, | 301 viewport4Series: {}, |
302 | 302 |
303 showWindowing: false, | 303 showWindowing: false, |
304 windowingPresets: [], | 304 windowingPresets: [], |
305 | 305 |
306 selectedStudies: [], | |
306 series: [], | 307 series: [], |
307 studies: [], | 308 studies: [], |
308 seriesIndex: {} // Maps "SeriesInstanceUID" to "index in this.series" | 309 seriesIndex: {} // Maps "SeriesInstanceUID" to "index in this.series" |
309 } | 310 } |
310 }, | 311 }, |
396 if (studyInstanceUid !== undefined) { | 397 if (studyInstanceUid !== undefined) { |
397 if (studyInstanceUid in indexStudies) { | 398 if (studyInstanceUid in indexStudies) { |
398 console.error('Twice the same study: ' + studyInstanceUid); | 399 console.error('Twice the same study: ' + studyInstanceUid); |
399 } else { | 400 } else { |
400 indexStudies[studyInstanceUid] = studies.length; | 401 indexStudies[studyInstanceUid] = studies.length; |
402 | |
403 var isSelected = (this.selectedStudies.length == 0 ? true : | |
404 this.selectedStudies.includes(studyInstanceUid)); | |
401 | 405 |
402 studies.push({ | 406 studies.push({ |
403 'studyInstanceUid' : studyInstanceUid, | 407 'studyInstanceUid' : studyInstanceUid, |
404 'series' : [ ], | 408 'series' : [ ], |
405 'color' : COLORS[posColor], | 409 'color' : COLORS[posColor], |
406 'selected' : true, | 410 'selected' : isSelected, |
407 'tags' : sourceStudies[i] | 411 'tags' : sourceStudies[i] |
408 }); | 412 }); |
409 | 413 |
410 posColor = (posColor + 1) % COLORS.length; | 414 posColor = (posColor + 1) % COLORS.length; |
411 } | 415 } |
721 stone.Setup(Module); | 725 stone.Setup(Module); |
722 stone.SetOrthancRoot('..', true); | 726 stone.SetOrthancRoot('..', true); |
723 stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); | 727 stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); |
724 console.warn('Stone properly initialized'); | 728 console.warn('Stone properly initialized'); |
725 | 729 |
730 var selectedStudies = getParameterFromUrl('selectedStudies'); | |
726 var study = getParameterFromUrl('study'); | 731 var study = getParameterFromUrl('study'); |
727 var series = getParameterFromUrl('series'); | 732 var series = getParameterFromUrl('series'); |
728 | 733 |
734 if (selectedStudies !== undefined) { | |
735 app.selectedStudies = selectedStudies.split(','); | |
736 } else { | |
737 app.selectedStudies = []; | |
738 } | |
739 | |
729 if (study === undefined) { | 740 if (study === undefined) { |
730 alert('No study was provided in the URL!'); | 741 alert('No study was provided in the URL!'); |
731 } else { | 742 } else { |
732 var studies = study.split(','); | 743 var studies = study.split(','); |
733 if (studies.length > 1) { | 744 if (studies.length > 1) { |