annotate OrthancStone/Samples/README.md @ 1521:bc4c50a53bd3

changed a few remaining instances of orthanc-stone/Samples to orthanc-stone/OrthancStone/Samples
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 31 Jul 2020 13:36:49 +0200
parents 307a805d0587
children 4c4b267e4004
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1360
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 General
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 =======
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 These samples assume that a recent version of Orthanc is checked out in an
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 `orthanc` folder next to the `orthanc-stone` folder. Let's call the top folder
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
5 the `devroot` folder. This name does not matter and is not used anywhere.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
6
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 Here's the directory layout that we suggest:
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
9 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 devroot/
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 |
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 +- orthanc/
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 |
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 +- orthanc-stone/
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
15 |
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
16 ...
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
17 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
18
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
19 Orthanc can be retrieved with:
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
20 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21 hg clone https://hg.orthanc-server.com/orthanc
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22 ```
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
23
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
24 Furthermore, the samples usually assume that an Orthanc is running locally,
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
25 without authentication, on port 8042. The samples can easily be tweaked if
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
26 your setup is different.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
27
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
28 When Dicom resources are to be displayed, their IDs can be supplied in the
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
29 various ways suitable for the platform (command-line arguments, URL parameters
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
30 or through the GUI)
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
31
1419
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
32
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
33 This repo contains two sample projects:
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
34
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
35 SingleFrameViewer
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
36 -----------------
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
37
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
38 This sample application displays a single frame of a Dicom instance that can
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
39 be loaded from Orthanc, either by using the Orthanc REST API or through the
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
40 Dicomweb server functionality of Orthanc.
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
41
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
42 RtViewer
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
43 --------
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
44
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
45 This sample application displays set of Radiotherapy data:
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
46 - a CT scan
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
47 - an RT-Dose
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
48 - an RT-Struct
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
49
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
50 The WebAssembly version displays 3 viewports with MPR data
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
51 while the SDL sample displays a single viewport.
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
52
1360
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 WebAssembly samples
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 ===================
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
56
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 Building the WebAssembly samples require the Emscripten SDK
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
58 (https://emscripten.org/). This SDK goes far beyond the simple compilation to
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
59 the wasm (Web Assembly) bytecode and provides a comprehensive library that
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60 eases porting native C and C++ programs and libraries. The Emscripten SDK also
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 makes it easy to generate the companion Javascript files requires to use a
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62 wasm module in a web application.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64 Although Emscripten runs on all major platforms, Stone of Orthanc is developed
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 and tested with the Linux version of Emscripten.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67 Emscripten runs perfectly fine under the Windows Subsystem for Linux (that is
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 the environment used quite often by the Stone of Orthanc team)
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
69
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
70 **Important note:** The following examples **and the build scripts** will
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71 assume that you have installed the Emscripten SDK in `~/apps/emsdk`.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
72
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73 The following packages should get you going (a Debian-like distribution such
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
74 as Debian or Ubuntu is assumed)
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
75
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
76 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77 sudo apt-get update
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
78 sudo apt-get install -y build-essential curl wget git python cmake pkg-config
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79 sudo apt-get install -y mercurial unzip npm ninja-build p7zip-full gettext-base
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
81
1419
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
82 To build the Wasm samples, just launch the `build-wasm-samples.sh` script from
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
83 this folder. Optionaly, you can pass the build type as an argument.
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
84 We suggest that you do *not* use the `Debug` configuration unless you really
1360
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
85 need it, for the additional checks that are made will lead to a very long
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 build time and much slower execution (more severe than with a native non-wasm
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87 target)
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
88
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
89 In order to run the sample, you may serve it with the ServeFolders plugin.
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
90 You can i.e: add such a section in your orthanc configuration file:
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
91
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
92 ```
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
93 {
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
94 "Plugins" : ["LibServeFolders.so],
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
95 "ServeFolders" : {
1419
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
96 "/single-frame-viewer" : "..../out/install-stone-wasm-samples-RelWithDebInfo/SingleFrameViewer",
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
97 "/rt-viewer": "..../out/install-stone-wasm-samples-RelWithDebInfo/RtViewer"
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
98 }
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
99 }
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
100 ```
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
101
1419
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
102 You'll then be able to open the single-frame-viewer demo at `http://localhost:8042/single-frame-viewer/index.html`
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
103
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
104 The rt-viewer demo at
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
105 `http://localhost:8044/rt-viewer/index.html?ctseries=a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa&rtdose=eac822ef-a395f94e-e8121fe0-8411fef8-1f7bffad&rtstruct=54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9`. Note that you must provide 3 ids in the url:
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
106
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
107 - the CT series Orthanc ID
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
108 - the RT-Dose instance Orthanc ID
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
109 - the RT-Struct instance Orthanc ID
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
110
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
111
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
112 RtViewer
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
113 -----------------
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
114
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
115 This sample application displays three MPR views of a CT+RTDOSE+RTSTRUCT dataset, loaded from Orthanc. The Orthanc IDs of the dataset must be supplied as URL parameters like:
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
116
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
117 ```
1517
307a805d0587 rtviewer --> stone-rtviewer
Benjamin Golinvaux <bgo@osimis.io>
parents: 1512
diff changeset
118 http://localhost:9979/stone-rtviewer/index.html?loglevel=info&ctseries=a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa&rtdose=830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb&rtstruct=54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
119 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
120
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
121 (notice the loglevel parameter that can be `warning`, `info` or `trace`, in increasing verbosity order)
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
122
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
123 This sample uses plain Javascript and requires the
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
124 Emscripten toolchain and cmake, in addition to a few standard packages.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
125
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
126 To build it, just launch the `build-wasm-RtViewer.sh` script from
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
127 this folder. Optionaly, you can pass the build type as an argument.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
128 We suggest that you do *not* use the `Debug` configuration unless you really
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
129 need it, for the additional checks that are made will lead to a very long
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
130 build time and much slower execution (more severe than with a native non-wasm
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
131 target)
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
132
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
133 In order to run the sample, you may serve it with the ServeFolders plugin.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
134 You can i.e: add such a section in your orthanc configuration file:
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
135
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
136 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
137 {
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
138 "Plugins" : ["LibServeFolders.so],
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
139 "ServeFolders" : {
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
140 "/rt-viewer" : "..../out/install-stone-wasm-RtViewer-RelWithDebInfo"
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
141 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
142 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
143 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
144
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
145 You'll then be able to open the demo at `http://localhost:8042/rt-viewer/index.html`
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
146
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
147
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
148 Native samples
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
149 =================
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
150
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
151 ### Windows build
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
152
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
153 Here's how to build the SdlSimpleViewer example using Visual Studio 2019
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
154 (the shell is Powershell, but the legacy shell can also be used with some
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
155 tweaks). This example is meant to be launched from the folder above
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
156 orthanc-stone.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
157
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
158 ```
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
159 # create the build folder and navigate to it
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
160 $buildDir = "build-stone-sdlviewer-msvc16-x64"
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
161
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
162 if (-not (Test-Path $buildDir)) {
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
163 mkdir -p $buildDir | Out-Null
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
164 }
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
165
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
166 cd $buildDir
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
167
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
168 # perform the configuration
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
169 cmake -G "Visual Studio 16 2019" -A x64 `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
170 -DMSVC_MULTIPLE_PROCESSES=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
171 -DALLOW_DOWNLOADS=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
172 -DSTATIC_BUILD=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
173 -DOPENSSL_NO_CAPIENG=ON `
1521
bc4c50a53bd3 changed a few remaining instances of orthanc-stone/Samples to orthanc-stone/OrthancStone/Samples
Benjamin Golinvaux <bgo@osimis.io>
parents: 1517
diff changeset
174 ../orthanc-stone/OrthancStone/Samples/Sdl
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
175
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
176 $solutionPath = ls -filter *.sln
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
177 Write-Host "Solution file(s) available at: $solutionPath"
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
178 ```
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
179
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
180 The initial configuration step will be quite lengthy, for CMake needs to
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
181 setup its internal cache based on your environment and build tools.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
182
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
183 Subsequent runs will be several orders of magnitude faster!
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
184
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
185 One the solution (.sln) file is ready, you can open it using the Visual Studio
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
186 IDE and choose Build --> Build solution.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
187
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
188 An alternative is to execute `cmake --build .` in the build folder created by
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
189 the script.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
190
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
191 In order to run the sample, make sure you've an Orthanc server running i.e. on
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
192 port 8042 and launch:
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
193
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
194 ```
1419
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
195 ./SdlSimpleViewer --orthanc http://localhost:8042 --instance 7fc84013-abef174e-3354ca83-b9cdb2a4-f1a74368
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
196
f5493e5a51a3 single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
Alain Mazy <alain@mazy.be>
parents: 1406
diff changeset
197 ./RtViewerSdl --orthanc http://localhost:8042 --ctseries a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa --rtdose 830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb --rtstruct 54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9
1395
62dc0d737e7b build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
Alain Mazy <alain@mazy.be>
parents: 1378
diff changeset
198 ```
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
199
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
200 RtViewer
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
201 ---------------
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
202
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
203 ### Windows build
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
204
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
205 Here's how to build the SdlSimpleViewer example using Visual Studio 2019
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
206 (the shell is Powershell, but the legacy shell can also be used with some
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
207 tweaks). This example is meant to be launched from the folder above
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
208 orthanc-stone.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
209
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
210 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
211 $buildRootDir = "out"
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
212 $buildDirName = "build-stone-sdl-RtViewer-msvc16-x64"
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
213 $buildDir = Join-Path -Path $buildRootDir -ChildPath $buildDirName
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
214
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
215 if (-not (Test-Path $buildDir)) {
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
216 mkdir -p $buildDir | Out-Null
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
217 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
218
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
219 cd $buildDir
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
220
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
221 cmake -G "Visual Studio 16 2019" -A x64 `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
222 -DMSVC_MULTIPLE_PROCESSES=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
223 -DALLOW_DOWNLOADS=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
224 -DSTATIC_BUILD=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
225 -DOPENSSL_NO_CAPIENG=ON `
1521
bc4c50a53bd3 changed a few remaining instances of orthanc-stone/Samples to orthanc-stone/OrthancStone/Samples
Benjamin Golinvaux <bgo@osimis.io>
parents: 1517
diff changeset
226 ../../orthanc-stone/OrthancStone/Samples/Sdl/RtViewer
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
227 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
228
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
229 Executing `cmake --build .` in the build folder will launch the Microsoft
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
230 builder on the solution.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
231
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
232 Alternatively, you can open and build the solution using Visual Studio 2019.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
233