changeset 3578:8e9e0739d3e8

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Nov 2019 17:27:25 +0100
parents 33cfcc74d1b1 (current diff) 35b4d56664a6 (diff)
children 74fc2a3b43bb
files
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancExplorer/explorer.js	Tue Nov 19 17:26:02 2019 +0100
+++ b/OrthancExplorer/explorer.js	Tue Nov 19 17:27:25 2019 +0100
@@ -163,6 +163,22 @@
     return d.toString('dddd, MMMM d, yyyy');
 }
 
+function FormatFloatSequence(s)
+{
+  if (s == undefined || s.length == 0)
+    return "-";
+
+  if (s.indexOf("\\") == -1)
+    return s;
+
+  var oldValues = s.split("\\");
+  var newValues = [];
+  for (var i = 0; i < oldValues.length; i++)
+  {
+    newValues.push(parseFloat(oldValues[i]).toFixed(3));
+  }
+  return newValues.join("\\");
+}
 
 function Sort(arr, fieldExtractor, isInteger, reverse)
 {
@@ -277,6 +293,11 @@
       {
         v = SplitLongUid(v);
       }
+      else if (i == "ImagePositionPatient" ||
+               i == "ImageOrientationPatient")
+      {
+        v = FormatFloatSequence(v);
+      }
       
       target.append($('<p>')
                     .text(i + ': ')
@@ -371,8 +392,7 @@
     "AcquisitionNumber", 
     "InstanceNumber", 
     "InstanceCreationDate", 
-    "InstanceCreationTime",
-    "ImagePositionPatient"
+    "InstanceCreationTime"
   ]);
     
   return CompleteFormatting(node, link, isReverse);