# HG changeset patch # User Sebastien Jodogne # Date 1560921687 -7200 # Node ID 8594f9bcd556a31144bb27a42a03d7a523e4c8a3 # Parent 78c9a7d207b8f35dec33d6fa9a08b0174001293c links to Orthanc Explorer diff -r 78c9a7d207b8 -r 8594f9bcd556 Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Tue Jun 18 19:08:02 2019 +0200 +++ b/Plugin/Plugin.cpp Wed Jun 19 07:21:27 2019 +0200 @@ -149,6 +149,56 @@ +void GetClientInformation(OrthancPluginRestOutput* output, + const char* /*url*/, + const OrthancPluginHttpRequest* request) +{ + OrthancPluginContext* context = OrthancPlugins::GetGlobalContext(); + + if (request->method != OrthancPluginHttpMethod_Get) + { + OrthancPluginSendMethodNotAllowed(context, output, "GET"); + } + else + { + std::string root = OrthancPlugins::Configuration::GetRoot(); + std::vector tokens; + Orthanc::Toolbox::TokenizeString(tokens, root, '/'); + int depth = 0; + for (size_t i = 0; i < tokens.size(); i++) + { + if (tokens[i].empty() || + tokens[i] == ".") + { + // Don't change the depth + } + else if (tokens[i] == "..") + { + depth--; + } + else + { + depth++; + } + } + + std::string orthancRoot = "./"; + for (int i = 0; i < depth; i++) + { + orthancRoot += "../"; + } + + Json::Value info = Json::objectValue; + info["DicomWebRoot"] = root; + info["OrthancRoot"] = orthancRoot; + + std::string answer = info.toStyledString(); + OrthancPluginAnswerBuffer(context, output, answer.c_str(), answer.size(), "application/json"); + } +} + + + void QidoClient(OrthancPluginRestOutput* output, const char* /*url*/, const OrthancPluginHttpRequest* request) @@ -655,6 +705,7 @@ (root + "app/libs/(.*)", true); OrthancPlugins::RegisterRestCallback(root + "app/client/(.*)", true); + OrthancPlugins::RegisterRestCallback(root + "app/info", true); std::string uri = root + "app/client/index.html"; OrthancPluginSetRootUri(context, uri.c_str()); diff -r 78c9a7d207b8 -r 8594f9bcd556 WebApplication/app.js --- a/WebApplication/app.js Tue Jun 18 19:08:02 2019 +0200 +++ b/WebApplication/app.js Wed Jun 19 07:21:27 2019 +0200 @@ -22,6 +22,7 @@ } }, data: { + orthancExplorerUri: '../../../', previewFailure: true, preview: DEFAULT_PREVIEW, showTruncatedStudies: false, @@ -123,7 +124,12 @@ app.serversInfo = response.data; app.servers = Object.keys(response.data).map(i => i); app.Clear(); - }) + }); + axios + .get('../info') + .then(response => { + app.orthancExplorerUri = response.data.OrthancRoot + '../../'; + }); }, methods: { ScrollToRef: function(refName) { diff -r 78c9a7d207b8 -r 8594f9bcd556 WebApplication/index.html --- a/WebApplication/index.html Tue Jun 18 19:08:02 2019 +0200 +++ b/WebApplication/index.html Wed Jun 19 07:21:27 2019 +0200 @@ -33,17 +33,28 @@

DICOMweb client

- This is a simple interface to the DICOMweb servers that are - configured in Orthanc. + This is a simple client interface to the DICOMweb + servers that are configured in Orthanc. From this page, + you can search the content of remote DICOMweb servers + (QIDO-RS), then locally retrieve the DICOM + studies/series of interest + (WADO-RS). Orthanc Explorer can be used to send + DICOM resources to remote DICOMweb servers (STOW-RS).

Open documentation + Open Orthanc Explorer

- Orthanc + + Orthanc +
@@ -82,13 +93,11 @@

-
-
- +

Studies

@@ -140,8 +149,7 @@ -
- +

Series