diff StoneWebViewer/Plugin/Plugin.cpp @ 1519:22d1bd085c19

split STONE_BINARIES into two different vars for both StoneWebViewer and RtViewer + fixed docker build + embed of RtViewer files + serving of RtViewer files + Orthanc explorer extension to open a series in the RtViewer : sibling series will be traversed and the first DOSE/STRUCT will be used. WARNING: needs work for PT and to allow for missing dose
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 31 Jul 2020 12:51:28 +0200
parents dd1d1cc0575d
children 61023b0d39c8
line wrap: on
line diff
--- a/StoneWebViewer/Plugin/Plugin.cpp	Fri Jul 31 12:47:27 2020 +0200
+++ b/StoneWebViewer/Plugin/Plugin.cpp	Fri Jul 31 12:51:28 2020 +0200
@@ -191,6 +191,8 @@
         explorer, Orthanc::EmbeddedResources::ORTHANC_EXPLORER);
       OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), explorer.c_str());
       
+      // Stone Web Viewer files
+      // ---------------------
       OrthancPlugins::RegisterRestCallback
         <ServeEmbeddedFile<Orthanc::EmbeddedResources::STONE_WEB_VIEWER_WASM> >
         ("/stone-webviewer/StoneWebViewer.wasm", true);
@@ -211,6 +213,28 @@
         <ServeEmbeddedFolder<Orthanc::EmbeddedResources::WEB_APPLICATION> >
         ("/stone-webviewer/(.*)", true);
 
+      // RtViewer files below.
+      // ---------------------
+      // we do not serve the whole directory at once (with ServeEmbeddedFolder)
+      // because it contains uppercase characters that are forbidden by the
+      // resource embedding system
+
+      OrthancPlugins::RegisterRestCallback
+        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_WASM_JS> >
+        ("/stone-rtviewer/RtViewerWasm.js", true);
+
+      OrthancPlugins::RegisterRestCallback
+        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_WASM> >
+        ("/stone-rtviewer/RtViewerWasm.wasm", true);
+
+      OrthancPlugins::RegisterRestCallback
+        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_WASM_APP_JS> >
+        ("/stone-rtviewer/RtViewerWasmApp.js", true);
+
+      OrthancPlugins::RegisterRestCallback
+        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_INDEX_HTML> >
+        ("/stone-rtviewer/index.html", true);
+
       OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
     }
     catch (...)