changeset 1861:9290d2916150

SeriesList: order series by SeriesNumber + hide non displayable series
author Alain Mazy <am@osimis.io>
date Tue, 21 Sep 2021 12:44:40 +0200
parents b8f54ab47b3b
children 63587fdeec69
files Applications/StoneWebViewer/NEWS Applications/StoneWebViewer/WebApplication/app.js
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/NEWS	Tue Sep 21 12:29:48 2021 +0200
+++ b/Applications/StoneWebViewer/NEWS	Tue Sep 21 12:44:40 2021 +0200
@@ -1,7 +1,10 @@
 Pending changes in the mainline
 ===============================
 
-* SeriesList: display the SeriesNumber tag in front of image count.
+* SeriesList: 
+  - display the SeriesNumber tag in front of image count.
+  - order series by SeriesNumber
+  - hide non displayable series (PR, SR)
 * In the top right overlay, display ContentDate/ContentTime if they are 
   available in the instance.  If not, StudyDate is displayed (previous
   behavior)
--- a/Applications/StoneWebViewer/WebApplication/app.js	Tue Sep 21 12:29:48 2021 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Tue Sep 21 12:44:40 2021 +0200
@@ -33,6 +33,7 @@
 var SERIES_DESCRIPTION = '0008,103e';
 var MODALITY = '0008,0060';
 var PATIENT_BIRTH_DATE = '0010,0030';
+var NON_DISPLAYABLE_MODALITIES = ['PR', 'SR']
 
 // Registry of the PDF series for which the instance metadata is still waiting
 var pendingSeriesPdf_ = {};
@@ -567,6 +568,12 @@
       var studies = [];
       var posColor = 0;
 
+      // order series by SeriesNumber
+      sourceSeries.sort((a, b) => {return a[SERIES_NUMBER] - b[SERIES_NUMBER];})
+
+      // discard non displayable series
+      sourceSeries = sourceSeries.filter((s) => {return NON_DISPLAYABLE_MODALITIES.indexOf(s[MODALITY]) == -1; } )
+
       for (var i = 0; i < sourceStudies.length; i++) {
         var studyInstanceUid = sourceStudies[i][STUDY_INSTANCE_UID];
         if (studyInstanceUid !== undefined) {