annotate Samples/README.md @ 1411:08fd094f9582

Merge
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 04 May 2020 13:34:46 +0200
parents 5d7ee14dc1eb
children f5493e5a51a3
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
1360
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
32
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
33 WebAssembly samples
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
34 ===================
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
35
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
36 Building the WebAssembly samples require the Emscripten SDK
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
37 (https://emscripten.org/). This SDK goes far beyond the simple compilation to
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 the wasm (Web Assembly) bytecode and provides a comprehensive library that
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39 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
40 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
41 wasm module in a web application.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43 Although Emscripten runs on all major platforms, Stone of Orthanc is developed
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44 and tested with the Linux version of Emscripten.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
45
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46 Emscripten runs perfectly fine under the Windows Subsystem for Linux (that is
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 the environment used quite often by the Stone of Orthanc team)
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 **Important note:** The following examples **and the build scripts** will
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 assume that you have installed the Emscripten SDK in `~/apps/emsdk`.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52 The following packages should get you going (a Debian-like distribution such
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 as Debian or Ubuntu is assumed)
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54
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 sudo apt-get update
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 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
58 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
59 ```
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 SingleFrameViewer
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62 -----------------
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 This sample application displays a single frame of a Dicom instance that can
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 be loaded from Orthanc, either by using the Orthanc REST API or through the
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66 Dicomweb server functionality of Orthanc.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 This barebones sample uses plain Javascript and requires the
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
69 Emscripten toolchain and cmake, in addition to a few standard packages.
a3b453a833e2 Some real doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
70
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
71 To build it, just launch the `build-wasm-SingleFrameViewer.sh` script from
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
72 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
73 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
74 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
75 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
76 target)
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
77
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
78 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
79 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
80
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
81 ```
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
82 {
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 "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
84 "ServeFolders" : {
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
85 "/single-frame-viewer" : "..../out/install-stone-wasm-SingleFrameViewer-RelWithDebInfo"
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
86 }
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
87 }
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
88 ```
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
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'll then be able to open the demo at `http://localhost:8042/single-frame-viewer/index.html`
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
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
93 RtViewer
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
94 -----------------
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
95
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
96 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
97
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
98 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
99 http://localhost:9979/rtviewer/index.html?loglevel=info&ctseries=a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa&rtdose=830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb&rtstruct=54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
100 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
101
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
102 (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
103
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
104 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
105 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
106
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
107 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
108 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
109 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
110 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
111 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
112 target)
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 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
115 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
116
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
117 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
118 {
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
119 "Plugins" : ["LibServeFolders.so],
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
120 "ServeFolders" : {
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
121 "/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
122 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
123 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
124 ```
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 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
127
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
128
1378
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
129 Native samples
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
130 =================
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
131
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
132 SdlSimpleViewer
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
133 ---------------
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
134
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
135 ### Windows build
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
136
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
137 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
138 (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
139 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
140 orthanc-stone.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
141
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
142 ```
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
143 # create the build folder and navigate to it
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
144 $buildDir = "build-stone-sdlviewer-msvc16-x64"
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
145
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
146 if (-not (Test-Path $buildDir)) {
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
147 mkdir -p $buildDir | Out-Null
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
148 }
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 cd $buildDir
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
151
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
152 # perform the configuration
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
153 cmake -G "Visual Studio 16 2019" -A x64 `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
154 -DMSVC_MULTIPLE_PROCESSES=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
155 -DALLOW_DOWNLOADS=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
156 -DSTATIC_BUILD=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
157 -DOPENSSL_NO_CAPIENG=ON `
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
158 ../orthanc-stone/Samples/Sdl/SimpleViewer
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
159
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
160 $solutionPath = ls -filter *.sln
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
161 Write-Host "Solution file(s) available at: $solutionPath"
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
162 ```
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
163
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
164 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
165 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
166
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
167 Subsequent runs will be several orders of magnitude faster!
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
168
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
169 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
170 IDE and choose Build --> Build solution.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
171
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
172 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
173 the script.
5b750a4e1b52 Doc for SDL sample
Benjamin Golinvaux <bgo@osimis.io>
parents: 1360
diff changeset
174
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
175 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
176 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
177
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
178 ```
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
179 ./SingleFrameViewer --orthanc http://localhost:8042 --instance 7fc84013-abef174e-3354ca83-b9cdb2a4-f1a74368
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
180 ```
1406
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
181
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
182 RtViewer
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
183 ---------------
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
184
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
185 ### Windows build
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
186
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
187 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
188 (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
189 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
190 orthanc-stone.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
191
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
192 ```
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
193 $buildRootDir = "out"
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
194 $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
195 $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
196
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
197 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
198 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
199 }
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
200
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
201 cd $buildDir
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 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
204 -DMSVC_MULTIPLE_PROCESSES=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
205 -DALLOW_DOWNLOADS=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
206 -DSTATIC_BUILD=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
207 -DOPENSSL_NO_CAPIENG=ON `
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
208 ../../orthanc-stone/Samples/Sdl/RtViewer
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 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
212 builder on the solution.
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
213
5d7ee14dc1eb Mouse wheel handler is now OK in SDL and Wasm
Benjamin Golinvaux <bgo@osimis.io>
parents: 1395
diff changeset
214 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
215