# HG changeset patch # User Benjamin Golinvaux # Date 1596369228 -7200 # Node ID 61023b0d39c8e3168fabdd97716ca021e4dd76db # Parent 31b0449a163ad847f0b7e9ca43e2324317c5cda5 Reverted the Stone Web Viewer plugin to rev. 307a805d0587 (mistakenly changed to serve the RT Viewer and make it available in the Orthanc Explorer while it should have been done in a separate plugin) diff -r 31b0449a163a -r 61023b0d39c8 StoneWebViewer/Plugin/CMakeLists.txt --- a/StoneWebViewer/Plugin/CMakeLists.txt Sat Aug 01 14:42:31 2020 +0200 +++ b/StoneWebViewer/Plugin/CMakeLists.txt Sun Aug 02 13:53:48 2020 +0200 @@ -14,8 +14,7 @@ -set(STONE_BINARIES_WEB_VIEWER CACHE PATH "Path to the binaries of the WebViewer \"../WebAssembly\" folder") -set(STONE_BINARIES_RT_VIEWER CACHE PATH "Path to the binaries of the RtViewer \"../WebAssembly\" folder") +set(STONE_BINARIES CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") # Parameters of the build set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") @@ -71,23 +70,15 @@ EmbedResources( - # Web Viewer Folders - IMAGES ${STONE_BINARIES_WEB_VIEWER}/img/ + # Folders + IMAGES ${STONE_BINARIES}/img/ WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication - # Explorer extension code + # Individual files ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js - - # Web viewer individual files - STONE_WEB_VIEWER_JS ${STONE_BINARIES_WEB_VIEWER}/StoneWebViewer.js - STONE_WEB_VIEWER_WASM ${STONE_BINARIES_WEB_VIEWER}/StoneWebViewer.wasm - STONE_WRAPPER ${STONE_BINARIES_WEB_VIEWER}/stone.js - - # RtViewer folder - RT_VIEWER_WASM_JS ${STONE_BINARIES_RT_VIEWER}/RtViewerWasm.js - RT_VIEWER_WASM ${STONE_BINARIES_RT_VIEWER}/RtViewerWasm.wasm - RT_VIEWER_WASM_APP_JS ${STONE_BINARIES_RT_VIEWER}/RtViewerWasmApp.js - RT_VIEWER_INDEX_HTML ${STONE_BINARIES_RT_VIEWER}/index.html + STONE_WEB_VIEWER_JS ${STONE_BINARIES}/StoneWebViewer.js + STONE_WEB_VIEWER_WASM ${STONE_BINARIES}/StoneWebViewer.wasm + STONE_WRAPPER ${STONE_BINARIES}/stone.js ) add_library(StoneWebViewer SHARED diff -r 31b0449a163a -r 61023b0d39c8 StoneWebViewer/Plugin/OrthancExplorer.js --- a/StoneWebViewer/Plugin/OrthancExplorer.js Sat Aug 01 14:42:31 2020 +0200 +++ b/StoneWebViewer/Plugin/OrthancExplorer.js Sun Aug 02 13:53:48 2020 +0200 @@ -55,91 +55,3 @@ } }); }); - -$('#series').live('pagebeforecreate', function() { - var b = $('') - .attr('data-role', 'button') - .attr('href', '#') - .attr('data-icon', 'search') - .attr('data-theme', 'e') - .text('Stone MPR RT Viewer');`` - - b.insertBefore($('#series-delete').parent().parent()); - b.click(function() { - if ($.mobile.pageData) { - $.ajax({ - url: '../series/' + $.mobile.pageData.uuid, - dataType: 'json', - cache: false, - success: function(series) { - - // we consider that the imaging series to display is the - // current one. - // we will look for RTDOSE and RTSTRUCT instances in the - // sibling series from the same study. The first one of - // each modality will be grabbed. - let ctSeries = $.mobile.pageData.uuid; - - $.ajax({ - url: '../studies/' + series.ParentStudy, - dataType: 'json', - cache: false, - success: function(study) { - // Loop on the study series and find the first RTSTRUCT and RTDOSE instances, - // if any. - let rtStructInstance = null; - let rtDoseInstance = null; - let rtPetInstance = null; - let seriesRequests = [] - - study.Series.forEach( function(studySeriesUuid) { - let request = $.ajax({ - url: '../series/' + studySeriesUuid, - dataType: 'json', - cache: false, - }); - seriesRequests.push(request); - }); - - $.when.apply($,seriesRequests).then(function() { - [].forEach.call(arguments, function(response) { - siblingSeries = response[0] - if (siblingSeries.MainDicomTags.Modality == "RTDOSE") { - // we have found an RTDOSE series. Let's grab the first instance - if (siblingSeries.Instances.length > 0) { - if(rtDoseInstance == null) { - rtDoseInstance = siblingSeries.Instances[0]; - } - } - } - if (siblingSeries.MainDicomTags.Modality == "PT") { - // we have found an RTDOSE series. Let's grab the first instance - if (siblingSeries.Instances.length > 0) { - if(rtPetInstance == null) { - rtPetInstance = siblingSeries.Instances[0]; - } - } - } - if (siblingSeries.MainDicomTags.Modality == "RTSTRUCT") { - // we have found an RTDOSE series. Let's grab the first instance - if (siblingSeries.Instances.length > 0) { - if(rtStructInstance == null) { - rtStructInstance = siblingSeries.Instances[0]; - } - } - } - }); - let mprViewerUrl = '../stone-rtviewer/index.html?ctseries=' + ctSeries + - '&rtdose=' + rtDoseInstance + - '&rtstruct=' + rtStructInstance; - //console.log("About to open: " + mprViewerUrl); - window.open(mprViewerUrl); - }); - } - }); - } - }); - } - }); -}); - diff -r 31b0449a163a -r 61023b0d39c8 StoneWebViewer/Plugin/Plugin.cpp --- a/StoneWebViewer/Plugin/Plugin.cpp Sat Aug 01 14:42:31 2020 +0200 +++ b/StoneWebViewer/Plugin/Plugin.cpp Sun Aug 02 13:53:48 2020 +0200 @@ -191,8 +191,6 @@ explorer, Orthanc::EmbeddedResources::ORTHANC_EXPLORER); OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), explorer.c_str()); - // Stone Web Viewer files - // --------------------- OrthancPlugins::RegisterRestCallback > ("/stone-webviewer/StoneWebViewer.wasm", true); @@ -213,28 +211,6 @@ > ("/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 - > - ("/stone-rtviewer/RtViewerWasm.js", true); - - OrthancPlugins::RegisterRestCallback - > - ("/stone-rtviewer/RtViewerWasm.wasm", true); - - OrthancPlugins::RegisterRestCallback - > - ("/stone-rtviewer/RtViewerWasmApp.js", true); - - OrthancPlugins::RegisterRestCallback - > - ("/stone-rtviewer/index.html", true); - OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback); } catch (...) diff -r 31b0449a163a -r 61023b0d39c8 StoneWebViewer/Plugin/docker-internal.sh --- a/StoneWebViewer/Plugin/docker-internal.sh Sat Aug 01 14:42:31 2020 +0200 +++ b/StoneWebViewer/Plugin/docker-internal.sh Sun Aug 02 13:53:48 2020 +0200 @@ -20,8 +20,7 @@ -DCMAKE_TOOLCHAIN_FILE=/tmp/orthanc/OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake \ -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework \ -DSTATIC_BUILD=ON \ - -DSTONE_BINARIES_WEB_VIEWER=/target/StoneWebViewer/ \ - -DSTONE_BINARIES_RT_VIEWER=/target/RtViewer/ \ + -DSTONE_BINARIES=/target/StoneWebViewer/ \ -DUSE_LEGACY_JSONCPP=ON \ -G Ninja