changeset 4461:22abc6851191

The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Jan 2021 14:51:48 +0100
parents 6831de40acd9
children da460bef88f8
files NEWS OrthancServer/OrthancExplorer/explorer.html OrthancServer/OrthancExplorer/explorer.js OrthancServer/OrthancExplorer/images/favicon.ico OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp
diffstat 5 files changed, 48 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Jan 20 14:20:37 2021 +0100
+++ b/NEWS	Wed Jan 20 14:51:48 2021 +0100
@@ -15,6 +15,11 @@
 * New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
 * New metadata automatically computed at the series level: "RemoteAET"
 
+Orthanc Explorer
+----------------
+
+* The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
+
 Plugins
 -------
 
--- a/OrthancServer/OrthancExplorer/explorer.html	Wed Jan 20 14:20:37 2021 +0100
+++ b/OrthancServer/OrthancExplorer/explorer.html	Wed Jan 20 14:51:48 2021 +0100
@@ -7,6 +7,8 @@
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <title>Orthanc Explorer</title>
 
+  <link rel="shortcut icon" href="images/favicon.ico">
+  
   <link rel="stylesheet" href="libs/jquery.mobile.min.css" />
   <link rel="stylesheet" href="libs/jqtree.css" />
   <link rel="stylesheet" href="libs/jquery.mobile.simpledialog.min.css" />
@@ -432,6 +434,12 @@
                 <input type="checkbox" id="show-tag-name" checked="checked" class="custom" data-mini="true" />
                 <label for="show-tag-name">Show tag description</label>
               </p>
+              <h2>Meta header</h2>
+              <div id="dicom-metaheader"></div>
+              <h2>Dataset</h2>
+              <p align="right" id="transfer-syntax">
+                <em>Transfer syntax: <span id="transfer-syntax-text"></span></em>
+              </p>
               <div id="dicom-tree"></div>
             </div>
           </div>
--- a/OrthancServer/OrthancExplorer/explorer.js	Wed Jan 20 14:20:37 2021 +0100
+++ b/OrthancServer/OrthancExplorer/explorer.js	Wed Jan 20 14:51:48 2021 +0100
@@ -98,20 +98,23 @@
 
 
 $(document).ready(function() {
-  var $tree = $('#dicom-tree');
-  $tree.tree({
-    autoEscape: false
-  });
+  var trees = [ '#dicom-tree', '#dicom-metaheader' ];
 
-  $('#dicom-tree').bind(
-    'tree.click',
-    function(event) {
-      if (event.node.is_open)
-        $tree.tree('closeNode', event.node, true);
-      else
-        $tree.tree('openNode', event.node, true);
-    }
-  );
+  for (var i = 0; i < trees.length; i++) {
+    $(trees[i]).tree({
+      autoEscape: false
+    });
+    
+    $(trees[i]).bind(
+      'tree.click',
+      function(event) {
+        if (event.node.is_open)
+          $(trees[i]).tree('closeNode', event.node, true);
+        else
+          $(trees[i]).tree('openNode', event.node, true);
+      }
+    );
+  }
 
   // Inject the template of the warning about insecure setup as the
   // first child of each page
@@ -902,6 +905,19 @@
               $('#dicom-tree').tree('loadData', ConvertForTree(s));
             });
 
+            GetResource('/instances/' + instance.ID + '/header', function(s) {
+              $('#dicom-metaheader').tree('loadData', ConvertForTree(s));
+            });
+
+            $('#transfer-syntax').hide();
+            GetResource('/instances/' + instance.ID + '/metadata?expand', function(s) {
+              transferSyntax = s['TransferSyntax'];
+              if (transferSyntax !== undefined) {
+                $('#transfer-syntax').show();
+                $('#transfer-syntax-text').text(transferSyntax);
+              }
+            });
+
             SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', 'AnonymizedFrom');
             SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', 'ModifiedFrom');
 
Binary file OrthancServer/OrthancExplorer/images/favicon.ico has changed
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Wed Jan 20 14:20:37 2021 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Wed Jan 20 14:51:48 2021 +0100
@@ -54,6 +54,11 @@
     call.GetOutput().Redirect("app/explorer.html");
   }
  
+  static void ServeFavicon(RestApiGetCall& call)
+  {
+    call.GetOutput().Redirect("app/images/favicon.ico");
+  }
+ 
   static void GetSystemInformation(RestApiGetCall& call)
   {
     if (call.IsDocumentation())
@@ -878,6 +883,7 @@
     if (orthancExplorerEnabled)
     {
       Register("/", ServeRoot);
+      Register("/favicon.ico", ServeFavicon);  // New in Orthanc 1.9.0
     }
     
     Register("/system", GetSystemInformation);