# HG changeset patch # User Sebastien Jodogne # Date 1606324302 -3600 # Node ID e787b52d025f1c0f8d737db78240f3214dadca35 # Parent 4a49de03a419478bf2e27558479a781749dfa1cc "selectedStudies" argument to replace "selectedStudyIds" from Osimis Web viewer diff -r 4a49de03a419 -r e787b52d025f Applications/StoneWebViewer/NOTES.txt --- a/Applications/StoneWebViewer/NOTES.txt Wed Nov 25 17:54:04 2020 +0100 +++ b/Applications/StoneWebViewer/NOTES.txt Wed Nov 25 18:11:42 2020 +0100 @@ -20,11 +20,30 @@ To open a single series: http://.../index.html?study=&series= -- The "pickableStudyIds" parameter in the URL (to specify a list of - studies to be displayed) is replaced by the single "study" GET - argument, that is allowed to contain a comma-separated list of - studies. The "series" parameter is ignored in this case. +- In the Osimis Web viewer, the "pickableStudyIds" parameter in the + URL defines the list of studies that are available for display, and + that are listed in the dropdown at the top-left of the interface. + + In the Stone Web viewer, "pickableStudyIds" is replaced by the + single "study" GET argument, that is allowed to contain a + comma-separated list of studies. The "series" parameter is ignored + in this case. To open a list of studies: http://.../index.html?study=,,... +- In the Osimis Web viewer, the "selectedStudyIds" defines the list of + studies that are selected in the dropdown (and therefore displayed + when the viewer starts). + + In the Stone Web viewer, "selectedStudyIds" is replaced by the + "selectedStudies" GET argument, that is allowed to contain a + comma-separated list of studies. + + To make a list of studies available, but display only one of those + studies when the viewer starts: + http://.../index.html?study=,,...&selectedStudies= + + If the "selectedStudies" is not provided, then all the studies are + displayed at the startup. + diff -r 4a49de03a419 -r e787b52d025f Applications/StoneWebViewer/WebApplication/app.js --- a/Applications/StoneWebViewer/WebApplication/app.js Wed Nov 25 17:54:04 2020 +0100 +++ b/Applications/StoneWebViewer/WebApplication/app.js Wed Nov 25 18:11:42 2020 +0100 @@ -303,6 +303,7 @@ showWindowing: false, windowingPresets: [], + selectedStudies: [], series: [], studies: [], seriesIndex: {} // Maps "SeriesInstanceUID" to "index in this.series" @@ -398,12 +399,15 @@ console.error('Twice the same study: ' + studyInstanceUid); } else { indexStudies[studyInstanceUid] = studies.length; + + var isSelected = (this.selectedStudies.length == 0 ? true : + this.selectedStudies.includes(studyInstanceUid)); studies.push({ 'studyInstanceUid' : studyInstanceUid, 'series' : [ ], 'color' : COLORS[posColor], - 'selected' : true, + 'selected' : isSelected, 'tags' : sourceStudies[i] }); @@ -723,9 +727,16 @@ stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); console.warn('Stone properly initialized'); + var selectedStudies = getParameterFromUrl('selectedStudies'); var study = getParameterFromUrl('study'); var series = getParameterFromUrl('series'); + if (selectedStudies !== undefined) { + app.selectedStudies = selectedStudies.split(','); + } else { + app.selectedStudies = []; + } + if (study === undefined) { alert('No study was provided in the URL!'); } else {