annotate Applications/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewer.cpp @ 1602:b2941196cabf

SortedFrames::LookupFrame()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Oct 2020 16:35:45 +0100
parents 4fb8fdf03314
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1457
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
1 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
2 * Stone of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
4 * Department, University Hospital of Liege, Belgium
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
6 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
7 * This program is free software: you can redistribute it and/or
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
10 * the License, or (at your option) any later version.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
11 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
12 * This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
15 * Affero General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1591
diff changeset
16 *
1457
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
19 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
21
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22 #include "SingleFrameViewerApplication.h"
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23
1543
4cfdaf4ef3fe fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
24 #include "../../../../OrthancStone/Sources/StoneException.h"
4cfdaf4ef3fe fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
25 #include "../../../../OrthancStone/Sources/StoneInitialization.h"
1591
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
26 #include "../../../Platforms/WebAssembly/WebGLViewport.h"
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
27 #include "../../../Platforms/WebAssembly/WebAssemblyLoadersContext.h"
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
28 #include "../../../Platforms/WebAssembly/WebGLViewportsRegistry.h"
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
29
1507
169adf9090a6 replacing deprecated std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1457
diff changeset
30 #include <Compatibility.h> // For std::unique_ptr<>
1457
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1388
diff changeset
31 #include <Toolbox.h>
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
32
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
33 #include <emscripten.h>
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
34 #include <emscripten/html5.h>
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
35
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
36
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
37 #define DISPATCH_JAVASCRIPT_EVENT(name) \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 EM_ASM( \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39 const customEvent = document.createEvent("CustomEvent"); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
40 customEvent.initCustomEvent(name, false, false, undefined); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
41 window.dispatchEvent(customEvent); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42 );
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44 #define EXTERN_CATCH_EXCEPTIONS \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
45 catch (Orthanc::OrthancException& e) \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46 { \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 LOG(ERROR) << "OrthancException: " << e.What(); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48 DISPATCH_JAVASCRIPT_EVENT("StoneException"); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 } \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 catch (OrthancStone::StoneException& e) \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51 { \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52 LOG(ERROR) << "StoneException: " << e.What(); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 DISPATCH_JAVASCRIPT_EVENT("StoneException"); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 } \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 catch (std::exception& e) \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
56 { \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 LOG(ERROR) << "Runtime error: " << e.what(); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
58 DISPATCH_JAVASCRIPT_EVENT("StoneException"); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
59 } \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60 catch (...) \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 { \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62 LOG(ERROR) << "Native exception"; \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63 DISPATCH_JAVASCRIPT_EVENT("StoneException"); \
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 namespace OrthancStone
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
69 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
70 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71
1507
169adf9090a6 replacing deprecated std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1457
diff changeset
72 static std::unique_ptr<OrthancStone::WebAssemblyLoadersContext> context_;
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73 static boost::shared_ptr<OrthancStone::Application> application_;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
74
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
75 extern "C"
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
76 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77 int main(int argc, char const *argv[])
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
78 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79 try
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
81 Orthanc::Logging::Initialize();
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
82 Orthanc::Logging::EnableInfoLevel(true);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
83 //Orthanc::Logging::EnableTraceLevel(true);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
84 LOG(WARNING) << "Initializing native Stone";
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
85
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 LOG(WARNING) << "Compiled with Emscripten " << __EMSCRIPTEN_major__
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87 << "." << __EMSCRIPTEN_minor__
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
88 << "." << __EMSCRIPTEN_tiny__;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
89
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
90 LOG(INFO) << "Endianness: " << Orthanc::EnumerationToString(Orthanc::Toolbox::DetectEndianness());
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
91 context_.reset(new OrthancStone::WebAssemblyLoadersContext(1, 4, 1));
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
92 context_->SetLocalOrthanc("..");
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
93 context_->SetDicomCacheSize(128 * 1024 * 1024); // 128MB
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
94
1388
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
95 DISPATCH_JAVASCRIPT_EVENT("WasmModuleInitialized");
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
96 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
97 EXTERN_CATCH_EXCEPTIONS;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
98
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
99 return 0;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
100 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
101
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
102 EMSCRIPTEN_KEEPALIVE
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
103 void InitializeViewport(const char* canvasId)
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
104 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
105 try
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 if (context_.get() == NULL)
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
108 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
109 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls,
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
110 "The loaders context is not available yet");
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
111 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
112
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113 if (application_.get() != NULL)
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
114 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls,
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 "Only one single viewport is available for this application");
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
117 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
118
1591
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
119 boost::shared_ptr<OrthancStone::WebGLViewport> viewport(
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
120 OrthancStone::WebGLViewportsRegistry::GetGlobalRegistry().Add(canvasId));
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
121 application_ = OrthancStone::Application::Create(*context_, viewport);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
122
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
123 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
124 OrthancStone::WebGLViewportsRegistry::Accessor accessor(
1591
5887a4f8594b moving platform-specific files out of the "OrthancStone" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1543
diff changeset
125 OrthancStone::WebGLViewportsRegistry::GetGlobalRegistry(), canvasId);
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
126
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
127 if (accessor.IsValid())
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
128 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
129 accessor.GetViewport().Invalidate();
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
130 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
131 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
132 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
133 EXTERN_CATCH_EXCEPTIONS;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
134 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
135
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
136
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
137 EMSCRIPTEN_KEEPALIVE
1388
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
138 void LoadFromOrthanc(const char* instance,
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
139 int frame)
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
140 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
141 try
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
142 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
143 if (application_.get() != NULL)
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
144 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
145 OrthancStone::DicomSource source;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
146 application_->LoadOrthancFrame(source, instance, frame);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
147 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
148 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
149 EXTERN_CATCH_EXCEPTIONS;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
150 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
151
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
152
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
153 EMSCRIPTEN_KEEPALIVE
1388
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
154 void LoadFromDicomWeb(const char* server,
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
155 const char* studyInstanceUid,
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
156 const char* seriesInstanceUid,
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
157 const char* sopInstanceUid,
240531afdd2d Dead code removal + removed untested Dicomweb + SingleFrameViewer wasm fixes
Benjamin Golinvaux <bgo@osimis.io>
parents: 1377
diff changeset
158 int frame)
1377
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
159 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
160 try
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
161 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
162 if (application_.get() != NULL)
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
163 {
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
164 OrthancStone::DicomSource source;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
165 source.SetDicomWebThroughOrthancSource(server);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
166 application_->LoadDicomWebFrame(source, studyInstanceUid, seriesInstanceUid,
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
167 sopInstanceUid, frame);
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
168 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
169 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
170 EXTERN_CATCH_EXCEPTIONS;
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
171 }
458ab069f313 Fixed missing file in WASM sample
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
172 }