annotate Applications/Samples/rt-viewer-demo/main.cpp @ 860:238693c3bc51 am-dev

merge default -> am-dev
author Alain Mazy <alain@mazy.be>
date Mon, 24 Jun 2019 14:35:00 +0200
parents 70992b38aa8a
children 2d8ab34c8c91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 /**
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 * Stone of Orthanc
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
6 *
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 * the License, or (at your option) any later version.
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 *
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
15 * Affero General Public License for more details.
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
16 *
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
19 **/
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
20
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21 #include "Applications/IStoneApplication.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22 #include "Framework/Widgets/WorldSceneWidget.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23 #include "Framework/Widgets/LayoutWidget.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
24
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
25 #if ORTHANC_ENABLE_WASM==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
26 #include "Platforms/Wasm/WasmPlatformApplicationAdapter.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
27 #include "Platforms/Wasm/Defaults.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
28 #include "Platforms/Wasm/WasmViewport.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
29 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
30
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
31 #if ORTHANC_ENABLE_QT==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
32 #include "Qt/SampleMainWindow.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
33 #include "Qt/SampleMainWindowWithButtons.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
34 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
35
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
36 #include "Framework/Layers/DicomSeriesVolumeSlicer.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
37 #include "Framework/Widgets/SliceViewerWidget.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 #include "Framework/Volumes/StructureSetLoader.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
40 #include <Core/Logging.h>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
41 #include <Core/OrthancException.h>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42 #include <Core/Images/ImageTraits.h>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44 #include <boost/math/constants/constants.hpp>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
45 #include "Framework/dev.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46 #include "Framework/Widgets/LayoutWidget.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 #include "Framework/Layers/DicomStructureSetSlicer.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 namespace OrthancStone
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51 namespace Samples
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 class RtViewerDemoBaseApplication : public IStoneApplication
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 protected:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
56 // ownership is transferred to the application context
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 #ifndef RESTORE_NON_RTVIEWERDEMO_BEHAVIOR
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
58 LayoutWidget* mainWidget_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
59 #else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60 WorldSceneWidget* mainWidget_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64 virtual void Initialize(StoneApplicationContext* context,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 IStatusBar& statusBar,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66 const boost::program_options::variables_map& parameters) ORTHANC_OVERRIDE
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
69
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
70 virtual std::string GetTitle() const ORTHANC_OVERRIDE
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
72 return "Stone of Orthanc - Sample";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
74
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
75 /**
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
76 * In the basic samples, the commands are handled by the platform adapter and NOT
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77 * by the application handler
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
78 */
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79 virtual void HandleSerializedMessage(const char* data) ORTHANC_OVERRIDE {};
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
81
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
82 virtual void Finalize() ORTHANC_OVERRIDE {}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
83 virtual IWidget* GetCentralWidget() ORTHANC_OVERRIDE {return mainWidget_;}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
84
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
85 #if ORTHANC_ENABLE_WASM==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 // default implementations for a single canvas named "canvas" in the HTML and an empty WasmApplicationAdapter
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
88 virtual void InitializeWasm() ORTHANC_OVERRIDE
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
89 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
90 AttachWidgetToWasmViewport("canvas", mainWidget_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
91 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
92
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
93 virtual WasmPlatformApplicationAdapter* CreateWasmApplicationAdapter(MessageBroker& broker)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
94 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
95 return new WasmPlatformApplicationAdapter(broker, *this);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
96 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
97 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
98
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
99 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
100
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
101 // this application actually works in Qt and WASM
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
102 class RtViewerDemoBaseSingleCanvasWithButtonsApplication : public RtViewerDemoBaseApplication
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
103 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
104 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
105 virtual void OnPushButton1Clicked() {}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106 virtual void OnPushButton2Clicked() {}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 virtual void OnTool1Clicked() {}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
108 virtual void OnTool2Clicked() {}
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
109
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
110 virtual void GetButtonNames(std::string& pushButton1,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
111 std::string& pushButton2,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
112 std::string& tool1,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113 std::string& tool2
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
114 ) {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 pushButton1 = "action1";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 pushButton2 = "action2";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
117 tool1 = "tool1";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
118 tool2 = "tool2";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
119 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
120
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
121 #if ORTHANC_ENABLE_QT==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
122 virtual QStoneMainWindow* CreateQtMainWindow() {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
123 return new SampleMainWindowWithButtons(dynamic_cast<OrthancStone::NativeStoneApplicationContext&>(*context_), *this);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
124 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
125 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
126
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
127 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
128
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
129 // this application actually works in SDL and WASM
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
130 class RtViewerDemoBaseApplicationSingleCanvas : public RtViewerDemoBaseApplication
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
131 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
132 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
133
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
134 #if ORTHANC_ENABLE_QT==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
135 virtual QStoneMainWindow* CreateQtMainWindow() {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
136 return new SampleMainWindow(dynamic_cast<OrthancStone::NativeStoneApplicationContext&>(*context_), *this);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
137 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
138 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
139 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
140 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
141 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
142
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
143
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
144
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
145 namespace OrthancStone
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
146 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
147 namespace Samples
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
148 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
149 template <Orthanc::PixelFormat T>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
150 void ReadDistributionInternal(std::vector<float>& distribution,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
151 const Orthanc::ImageAccessor& image)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
152 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
153 const unsigned int width = image.GetWidth();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
154 const unsigned int height = image.GetHeight();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
155
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
156 distribution.resize(width * height);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
157 size_t pos = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
158
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
159 for (unsigned int y = 0; y < height; y++)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
160 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
161 for (unsigned int x = 0; x < width; x++, pos++)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
162 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
163 distribution[pos] = Orthanc::ImageTraits<T>::GetFloatPixel(image, x, y);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
164 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
165 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
166 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
167
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
168 void ReadDistribution(std::vector<float>& distribution,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
169 const Orthanc::ImageAccessor& image)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
170 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
171 switch (image.GetFormat())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
172 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
173 case Orthanc::PixelFormat_Grayscale8:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
174 ReadDistributionInternal<Orthanc::PixelFormat_Grayscale8>(distribution, image);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
175 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
176
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
177 case Orthanc::PixelFormat_Grayscale16:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
178 ReadDistributionInternal<Orthanc::PixelFormat_Grayscale16>(distribution, image);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
179 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
180
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
181 case Orthanc::PixelFormat_SignedGrayscale16:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
182 ReadDistributionInternal<Orthanc::PixelFormat_SignedGrayscale16>(distribution, image);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
183 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
184
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
185 case Orthanc::PixelFormat_Grayscale32:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
186 ReadDistributionInternal<Orthanc::PixelFormat_Grayscale32>(distribution, image);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
187 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
188
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
189 case Orthanc::PixelFormat_Grayscale64:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
190 ReadDistributionInternal<Orthanc::PixelFormat_Grayscale64>(distribution, image);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
191 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
192
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
193 default:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
194 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
195 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
196 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
197
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
198
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
199 class DoseInteractor : public VolumeImageInteractor
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
200 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
201 private:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
202 SliceViewerWidget& widget_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
203 size_t layer_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
204 DicomFrameConverter converter_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
205
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
206
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
207
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
208 protected:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
209 virtual void NotifySliceChange(const ISlicedVolume& slicedVolume,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
210 const size_t& sliceIndex,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
211 const Slice& slice)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
212 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
213 converter_ = slice.GetConverter();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
214
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
215 #if 0
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
216 const OrthancVolumeImage& volume = dynamic_cast<const OrthancVolumeImage&>(slicedVolume);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
217
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
218 RenderStyle s = widget_.GetLayerStyle(layer_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
219
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
220 if (volume.FitWindowingToRange(s, slice.GetConverter()))
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
221 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
222 printf("Windowing: %f => %f\n", s.customWindowCenter_, s.customWindowWidth_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
223 widget_.SetLayerStyle(layer_, s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
224 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
225 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
226 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
227
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
228 virtual void NotifyVolumeReady(const ISlicedVolume& slicedVolume)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
229 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
230 const float percentile = 0.01f;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
231 const OrthancVolumeImage& volume = dynamic_cast<const OrthancVolumeImage&>(slicedVolume);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
232
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
233 std::vector<float> distribution;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
234 ReadDistribution(distribution, volume.GetImage().GetInternalImage());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
235 std::sort(distribution.begin(), distribution.end());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
236
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
237 int start = static_cast<int>(std::ceil(distribution.size() * percentile));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
238 int end = static_cast<int>(std::floor(distribution.size() * (1.0f - percentile)));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
239
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
240 float a = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
241 float b = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
242
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
243 if (start < end &&
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
244 start >= 0 &&
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
245 end < static_cast<int>(distribution.size()))
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
246 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
247 a = distribution[start];
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
248 b = distribution[end];
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
249 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
250 else if (!distribution.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
251 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
252 // Too small distribution: Use full range
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
253 a = distribution.front();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
254 b = distribution.back();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
255 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
256
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
257 //printf("%f %f\n", a, b);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
258
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
259 RenderStyle s = widget_.GetLayerStyle(layer_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
260 s.windowing_ = ImageWindowing_Custom;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
261 s.customWindowCenter_ = static_cast<float>(converter_.Apply((a + b) / 2.0f));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
262 s.customWindowWidth_ = static_cast<float>(converter_.Apply(b - a));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
263
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
264 // 96.210556 => 192.421112
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
265 widget_.SetLayerStyle(layer_, s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
266 printf("Windowing: %f => %f\n", s.customWindowCenter_, s.customWindowWidth_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
267 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
268
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
269 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
270 DoseInteractor(MessageBroker& broker, OrthancVolumeImage& volume,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
271 SliceViewerWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
272 VolumeProjection projection,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
273 size_t layer) :
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
274 VolumeImageInteractor(broker, volume, widget, projection),
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
275 widget_(widget),
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
276 layer_(layer)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
277 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
278 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
279 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
280
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
281 class RtViewerDemoApplication :
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
282 public RtViewerDemoBaseApplicationSingleCanvas,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
283 public IObserver
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
284 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
285 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
286 std::vector<std::pair<SliceViewerWidget*, size_t> > doseCtWidgetLayerPairs_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
287 std::list<OrthancStone::IWorldSceneInteractor*> interactors_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
288
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
289 class Interactor : public IWorldSceneInteractor
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
290 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
291 private:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
292 RtViewerDemoApplication& application_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
293
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
294 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
295 Interactor(RtViewerDemoApplication& application) :
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
296 application_(application)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
297 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
298 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
299
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
300 virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
301 const ViewportGeometry& view,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
302 MouseButton button,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
303 KeyboardModifiers modifiers,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
304 int viewportX,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
305 int viewportY,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
306 double x,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
307 double y,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
308 IStatusBar* statusBar,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
309 const std::vector<Touch>& displayTouches)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
310 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
311 return NULL;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
312 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
313
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
314 virtual void MouseOver(CairoContext& context,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
315 WorldSceneWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
316 const ViewportGeometry& view,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
317 double x,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
318 double y,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
319 IStatusBar* statusBar)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
320 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
321 if (statusBar != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
322 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
323 Vector p = dynamic_cast<SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
324
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
325 char buf[64];
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
326 sprintf(buf, "X = %.02f Y = %.02f Z = %.02f (in cm)",
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
327 p[0] / 10.0, p[1] / 10.0, p[2] / 10.0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
328 statusBar->SetMessage(buf);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
329 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
330 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
331
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
332 virtual void MouseWheel(WorldSceneWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
333 MouseWheelDirection direction,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
334 KeyboardModifiers modifiers,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
335 IStatusBar* statusBar)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
336 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
337 int scale = (modifiers & KeyboardModifiers_Control ? 10 : 1);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
338
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
339 switch (direction)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
340 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
341 case MouseWheelDirection_Up:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
342 application_.OffsetSlice(-scale);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
343 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
344
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
345 case MouseWheelDirection_Down:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
346 application_.OffsetSlice(scale);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
347 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
348
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
349 default:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
350 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
351 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
352 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
353
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
354 virtual void KeyPressed(WorldSceneWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
355 KeyboardKeys key,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
356 char keyChar,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
357 KeyboardModifiers modifiers,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
358 IStatusBar* statusBar)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
359 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
360 switch (keyChar)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
361 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
362 case 's':
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
363 // TODO: recursively traverse children
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
364 widget.FitContent();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
365 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
366
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
367 default:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
368 break;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
369 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
370 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
371 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
372
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
373 void OffsetSlice(int offset)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
374 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
375 if (source_ != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
376 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
377 int slice = static_cast<int>(slice_) + offset;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
378
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
379 if (slice < 0)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
380 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
381 slice = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
382 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
383
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
384 if (slice >= static_cast<int>(source_->GetSliceCount()))
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
385 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
386 slice = static_cast<int>(source_->GetSliceCount()) - 1;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
387 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
388
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
389 if (slice != static_cast<int>(slice_))
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
390 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
391 SetSlice(slice);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
392 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
393 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
394 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
395
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
396
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
397 SliceViewerWidget& GetMainWidget()
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
398 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
399 return *dynamic_cast<SliceViewerWidget*>(mainWidget_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
400 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
401
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
402
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
403 void SetSlice(size_t index)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
404 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
405 if (source_ != NULL &&
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
406 index < source_->GetSliceCount())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
407 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
408 slice_ = static_cast<unsigned int>(index);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
409
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
410 #if 1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
411 GetMainWidget().SetSlice(source_->GetSlice(slice_).GetGeometry());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
412 #else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
413 // TEST for scene extents - Rotate the axes
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
414 double a = 15.0 / 180.0 * boost::math::constants::pi<double>();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
415
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
416 #if 1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
417 Vector x; GeometryToolbox::AssignVector(x, cos(a), sin(a), 0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
418 Vector y; GeometryToolbox::AssignVector(y, -sin(a), cos(a), 0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
419 #else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
420 // Flip the normal
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
421 Vector x; GeometryToolbox::AssignVector(x, cos(a), sin(a), 0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
422 Vector y; GeometryToolbox::AssignVector(y, sin(a), -cos(a), 0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
423 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
424
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
425 SliceGeometry s(source_->GetSlice(slice_).GetGeometry().GetOrigin(), x, y);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
426 widget_->SetSlice(s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
427 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
428 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
429 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
430
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
431
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
432 void OnMainWidgetGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
433 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
434 // Once the geometry of the series is downloaded from Orthanc,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
435 // display its middle slice, and adapt the viewport to fit this
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
436 // slice
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
437 if (source_ == &message.GetOrigin())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
438 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
439 SetSlice(source_->GetSliceCount() / 2);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
440 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
441
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
442 GetMainWidget().FitContent();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
443 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
444
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
445 DicomFrameConverter converter_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
446
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
447 void OnSliceContentChangedMessage(const ISlicedVolume::SliceContentChangedMessage& message)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
448 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
449 converter_ = message.GetSlice().GetConverter();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
450 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
451
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
452 void OnVolumeReadyMessage(const ISlicedVolume::VolumeReadyMessage& message)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
453 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
454 const float percentile = 0.01f;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
455
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
456 auto& slicedVolume = message.GetOrigin();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
457 const OrthancVolumeImage& volume = dynamic_cast<const OrthancVolumeImage&>(slicedVolume);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
458
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
459 std::vector<float> distribution;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
460 ReadDistribution(distribution, volume.GetImage().GetInternalImage());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
461 std::sort(distribution.begin(), distribution.end());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
462
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
463 int start = static_cast<int>(std::ceil(distribution.size() * percentile));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
464 int end = static_cast<int>(std::floor(distribution.size() * (1.0f - percentile)));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
465
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
466 float a = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
467 float b = 0;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
468
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
469 if (start < end &&
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
470 start >= 0 &&
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
471 end < static_cast<int>(distribution.size()))
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
472 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
473 a = distribution[start];
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
474 b = distribution[end];
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
475 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
476 else if (!distribution.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
477 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
478 // Too small distribution: Use full range
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
479 a = distribution.front();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
480 b = distribution.back();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
481 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
482
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
483 //printf("WINDOWING %f %f\n", a, b);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
484
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
485 for (const auto& pair : doseCtWidgetLayerPairs_)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
486 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
487 auto widget = pair.first;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
488 auto layer = pair.second;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
489 RenderStyle s = widget->GetLayerStyle(layer);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
490 s.windowing_ = ImageWindowing_Custom;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
491 s.customWindowCenter_ = static_cast<float>(converter_.Apply((a + b) / 2.0f));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
492 s.customWindowWidth_ = static_cast<float>(converter_.Apply(b - a));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
493
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
494 // 96.210556 => 192.421112
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
495 widget->SetLayerStyle(layer, s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
496 printf("Windowing: %f => %f\n", s.customWindowCenter_, s.customWindowWidth_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
497 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
498 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
499
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
500
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
501
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
502 size_t AddDoseLayer(SliceViewerWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
503 OrthancVolumeImage& volume, VolumeProjection projection);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
504
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
505 void AddStructLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
506 SliceViewerWidget& widget, StructureSetLoader& loader);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
507
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
508 SliceViewerWidget* CreateDoseCtWidget(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
509 std::auto_ptr<OrthancVolumeImage>& ct,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
510 std::auto_ptr<OrthancVolumeImage>& dose,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
511 std::auto_ptr<StructureSetLoader>& structLoader,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
512 VolumeProjection projection);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
513
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
514 void AddCtLayer(SliceViewerWidget& widget, OrthancVolumeImage& volume);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
515
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
516 std::auto_ptr<Interactor> mainWidgetInteractor_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
517 const DicomSeriesVolumeSlicer* source_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
518 unsigned int slice_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
519
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
520 std::string ctSeries_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
521 std::string doseInstance_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
522 std::string doseSeries_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
523 std::string structInstance_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
524 std::auto_ptr<OrthancStone::OrthancVolumeImage> dose_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
525 std::auto_ptr<OrthancStone::OrthancVolumeImage> ct_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
526 std::auto_ptr<OrthancStone::StructureSetLoader> struct_;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
527
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
528 public:
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
529 RtViewerDemoApplication(MessageBroker& broker) :
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
530 IObserver(broker),
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
531 source_(NULL),
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
532 slice_(0)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
533 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
534 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
535
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
536 /*
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
537 dev options on bgo xps15
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
538
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
539 COMMAND LINE
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
540 --ct-series=a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa --dose-instance=830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb --struct-instance=54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
541
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
542 URL PARAMETERS
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
543 ?ct-series=a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa&dose-instance=830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb&struct-instance=54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
544
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
545 */
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
546
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
547 void ParseParameters(const boost::program_options::variables_map& parameters)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
548 {
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
549 // Generic
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
550 {
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
551 if (parameters.count("verbose"))
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
552 {
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
553 Orthanc::Logging::EnableInfoLevel(true);
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
554 LOG(INFO) << "Verbose logs (info) are enabled";
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
555 }
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
556 }
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
557
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
558 {
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
559 if (parameters.count("trace"))
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
560 {
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
561 LOG(INFO) << "parameters.count(\"trace\") != 0";
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
562 Orthanc::Logging::EnableTraceLevel(true);
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
563 VLOG(1) << "Trace logs (debug) are enabled";
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
564 }
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
565 }
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
566
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
567 // CT series
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
568 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
569
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
570 if (parameters.count("ct-series") != 1)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
571 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
572 LOG(ERROR) << "There must be exactly one CT series specified";
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
573 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
574 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
575 ctSeries_ = parameters["ct-series"].as<std::string>();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
576 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
577
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
578 // RTDOSE
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
579 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
580 if (parameters.count("dose-instance") == 1)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
581 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
582 doseInstance_ = parameters["dose-instance"].as<std::string>();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
583 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
584 else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
585 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
586 #ifdef BGO_NOT_IMPLEMENTED_YET
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
587 // Dose series
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
588 if (parameters.count("dose-series") != 1)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
589 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
590 LOG(ERROR) << "the RTDOSE series is missing";
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
591 throw Orthanc::OrthancException(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
592 Orthanc::ErrorCode_ParameterOutOfRange);
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
593 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
594 doseSeries_ = parameters["ct"].as<std::string>();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
595 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
596 LOG(ERROR) << "the RTSTRUCT instance is missing";
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
597 throw Orthanc::OrthancException(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
598 Orthanc::ErrorCode_ParameterOutOfRange);
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
599 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
600 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
601
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
602 // RTSTRUCT
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
603 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
604 if (parameters.count("struct-instance") == 1)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
605 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
606 structInstance_ = parameters["struct-instance"].as<std::string>();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
607 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
608 else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
609 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
610 #ifdef BGO_NOT_IMPLEMENTED_YET
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
611 // Struct series
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
612 if (parameters.count("struct-series") != 1)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
613 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
614 LOG(ERROR) << "the RTSTRUCT series is missing";
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
615 throw Orthanc::OrthancException(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
616 Orthanc::ErrorCode_ParameterOutOfRange);
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
617 }
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
618 structSeries_ = parameters["struct-series"].as<std::string>();
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
619 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
620 LOG(ERROR) << "the RTSTRUCT instance is missing";
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
621 throw Orthanc::OrthancException(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
622 Orthanc::ErrorCode_ParameterOutOfRange);
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
623 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
624 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
625 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
626
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
627 virtual void DeclareStartupOptions(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
628 boost::program_options::options_description& options)
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
629 {
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
630 boost::program_options::options_description generic(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
631 "RtViewerDemo options. Please note that some of these options "
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
632 "are mutually exclusive");
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
633 generic.add_options()
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
634 ("ct-series", boost::program_options::value<std::string>(),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
635 "Orthanc ID of the CT series")
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
636 ("dose-instance", boost::program_options::value<std::string>(),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
637 "Orthanc ID of the RTDOSE instance (incompatible with dose-series)")
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
638 ("dose-series", boost::program_options::value<std::string>(),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
639 "NOT IMPLEMENTED YET. Orthanc ID of the RTDOSE series (incompatible"
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
640 " with dose-instance)")
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
641 ("struct-instance", boost::program_options::value<std::string>(),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
642 "Orthanc ID of the RTSTRUCT instance (incompatible with struct-"
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
643 "series)")
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
644 ("struct-series", boost::program_options::value<std::string>(),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
645 "NOT IMPLEMENTED YET. Orthanc ID of the RTSTRUCT (incompatible with"
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
646 " struct-instance)")
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
647 ("smooth", boost::program_options::value<bool>()->default_value(true),
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
648 "Enable bilinear image smoothing")
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
649 ;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
650
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
651 options.add(generic);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
652 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
653
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
654 virtual void Initialize(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
655 StoneApplicationContext* context,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
656 IStatusBar& statusBar,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
657 const boost::program_options::variables_map& parameters)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
658 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
659 using namespace OrthancStone;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
660
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
661 ParseParameters(parameters);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
662
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
663 context_ = context;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
664
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
665 statusBar.SetMessage("Use the key \"s\" to reinitialize the layout");
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
666
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
667 if (!ctSeries_.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
668 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
669 printf("CT = [%s]\n", ctSeries_.c_str());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
670
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
671 ct_.reset(new OrthancStone::OrthancVolumeImage(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
672 IObserver::GetBroker(), context->GetOrthancApiClient(), false));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
673 ct_->ScheduleLoadSeries(ctSeries_);
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
674 //ct_->ScheduleLoadSeries(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
675 // "a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); // IBA
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
676 //ct_->ScheduleLoadSeries(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
677 // "03677739-1d8bca40-db1daf59-d74ff548-7f6fc9c0"); // 0522c0001 TCIA
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
678 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
679
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
680 if (!doseSeries_.empty() ||
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
681 !doseInstance_.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
682 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
683 dose_.reset(new OrthancStone::OrthancVolumeImage(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
684 IObserver::GetBroker(), context->GetOrthancApiClient(), true));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
685
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
686
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
687 dose_->RegisterObserverCallback(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
688 new Callable<RtViewerDemoApplication, ISlicedVolume::VolumeReadyMessage>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
689 (*this, &RtViewerDemoApplication::OnVolumeReadyMessage));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
690
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
691 dose_->RegisterObserverCallback(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
692 new Callable<RtViewerDemoApplication, ISlicedVolume::SliceContentChangedMessage>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
693 (*this, &RtViewerDemoApplication::OnSliceContentChangedMessage));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
694
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
695 if (doseInstance_.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
696 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
697 dose_->ScheduleLoadSeries(doseSeries_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
698 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
699 else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
700 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
701 dose_->ScheduleLoadInstance(doseInstance_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
702 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
703
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
704 //dose_->ScheduleLoadInstance(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
705 //"830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // IBA 1
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
706 //dose_->ScheduleLoadInstance(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
707 //"269f26f4-0c83eeeb-2e67abbd-5467a40f-f1bec90c"); //0522c0001 TCIA
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
708 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
709
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
710 if (!structInstance_.empty())
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
711 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
712 struct_.reset(new OrthancStone::StructureSetLoader(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
713 IObserver::GetBroker(), context->GetOrthancApiClient()));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
714
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
715 struct_->ScheduleLoadInstance(structInstance_);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
716
603
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
717 //struct_->ScheduleLoadInstance(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
718 //"54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9"); // IBA
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
719 //struct_->ScheduleLoadInstance(
70992b38aa8a new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents: 549
diff changeset
720 //"17cd032b-ad92a438-ca05f06a-f9e96668-7e3e9e20"); // 0522c0001 TCIA
549
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
721 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
722
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
723 mainWidget_ = new LayoutWidget("main-layout");
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
724 mainWidget_->SetBackgroundColor(0, 0, 0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
725 mainWidget_->SetBackgroundCleared(true);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
726 mainWidget_->SetPadding(0);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
727
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
728 auto axialWidget = CreateDoseCtWidget
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
729 (ct_, dose_, struct_, OrthancStone::VolumeProjection_Axial);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
730 mainWidget_->AddWidget(axialWidget);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
731
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
732 std::auto_ptr<OrthancStone::LayoutWidget> subLayout(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
733 new OrthancStone::LayoutWidget("main-layout"));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
734 subLayout->SetVertical();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
735 subLayout->SetPadding(5);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
736
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
737 auto coronalWidget = CreateDoseCtWidget
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
738 (ct_, dose_, struct_, OrthancStone::VolumeProjection_Coronal);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
739 subLayout->AddWidget(coronalWidget);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
740
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
741 auto sagittalWidget = CreateDoseCtWidget
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
742 (ct_, dose_, struct_, OrthancStone::VolumeProjection_Sagittal);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
743 subLayout->AddWidget(sagittalWidget);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
744
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
745 mainWidget_->AddWidget(subLayout.release());
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
746 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
747 };
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
748
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
749
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
750 size_t RtViewerDemoApplication::AddDoseLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
751 SliceViewerWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
752 OrthancVolumeImage& volume, VolumeProjection projection)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
753 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
754 size_t layer = widget.AddLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
755 new VolumeImageMPRSlicer(IObserver::GetBroker(), volume));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
756
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
757 RenderStyle s;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
758 //s.drawGrid_ = true;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
759 s.SetColor(255, 0, 0); // Draw missing PET layer in red
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
760 s.alpha_ = 0.3f;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
761 s.applyLut_ = true;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
762 s.lut_ = Orthanc::EmbeddedResources::COLORMAP_JET;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
763 s.interpolation_ = ImageInterpolation_Bilinear;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
764 widget.SetLayerStyle(layer, s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
765
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
766 return layer;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
767 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
768
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
769 void RtViewerDemoApplication::AddStructLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
770 SliceViewerWidget& widget, StructureSetLoader& loader)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
771 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
772 widget.AddLayer(new DicomStructureSetSlicer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
773 IObserver::GetBroker(), loader));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
774 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
775
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
776 SliceViewerWidget* RtViewerDemoApplication::CreateDoseCtWidget(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
777 std::auto_ptr<OrthancVolumeImage>& ct,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
778 std::auto_ptr<OrthancVolumeImage>& dose,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
779 std::auto_ptr<StructureSetLoader>& structLoader,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
780 VolumeProjection projection)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
781 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
782 std::auto_ptr<OrthancStone::SliceViewerWidget> widget(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
783 new OrthancStone::SliceViewerWidget(IObserver::GetBroker(),
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
784 "ct-dose-widget"));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
785
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
786 if (ct.get() != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
787 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
788 AddCtLayer(*widget, *ct);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
789 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
790
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
791 if (dose.get() != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
792 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
793 size_t layer = AddDoseLayer(*widget, *dose, projection);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
794
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
795 // we need to store the dose rendering widget because we'll update them
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
796 // according to various asynchronous events
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
797 doseCtWidgetLayerPairs_.push_back(std::make_pair(widget.get(), layer));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
798 #if 0
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
799 interactors_.push_back(new VolumeImageInteractor(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
800 IObserver::GetBroker(), *dose, *widget, projection));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
801 #else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
802 interactors_.push_back(new DoseInteractor(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
803 IObserver::GetBroker(), *dose, *widget, projection, layer));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
804 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
805 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
806 else if (ct.get() != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
807 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
808 interactors_.push_back(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
809 new VolumeImageInteractor(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
810 IObserver::GetBroker(), *ct, *widget, projection));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
811 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
812
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
813 if (structLoader.get() != NULL)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
814 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
815 AddStructLayer(*widget, *structLoader);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
816 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
817
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
818 return widget.release();
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
819 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
820
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
821 void RtViewerDemoApplication::AddCtLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
822 SliceViewerWidget& widget,
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
823 OrthancVolumeImage& volume)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
824 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
825 size_t layer = widget.AddLayer(
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
826 new VolumeImageMPRSlicer(IObserver::GetBroker(), volume));
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
827
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
828 RenderStyle s;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
829 //s.drawGrid_ = true;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
830 s.alpha_ = 1;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
831 s.windowing_ = ImageWindowing_Bone;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
832 widget.SetLayerStyle(layer, s);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
833 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
834 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
835 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
836
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
837
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
838
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
839 #if ORTHANC_ENABLE_WASM==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
840
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
841 #include "Platforms/Wasm/WasmWebService.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
842 #include "Platforms/Wasm/WasmViewport.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
843
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
844 #include <emscripten/emscripten.h>
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
845
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
846 //#include "SampleList.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
847
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
848
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
849 OrthancStone::IStoneApplication* CreateUserApplication(OrthancStone::MessageBroker& broker)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
850 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
851 return new OrthancStone::Samples::RtViewerDemoApplication(broker);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
852 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
853
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
854 OrthancStone::WasmPlatformApplicationAdapter* CreateWasmApplicationAdapter(OrthancStone::MessageBroker& broker, OrthancStone::IStoneApplication* application)
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
855 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
856 return dynamic_cast<OrthancStone::Samples::RtViewerDemoApplication*>(application)->CreateWasmApplicationAdapter(broker);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
857 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
858
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
859 #else
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
860
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
861 //#include "SampleList.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
862 #if ORTHANC_ENABLE_SDL==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
863 #include "Applications/Sdl/SdlStoneApplicationRunner.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
864 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
865 #if ORTHANC_ENABLE_QT==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
866 #include "Applications/Qt/SampleQtApplicationRunner.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
867 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
868 #include "Framework/Messages/MessageBroker.h"
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
869
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
870 int main(int argc, char* argv[])
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
871 {
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
872 OrthancStone::MessageBroker broker;
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
873 OrthancStone::Samples::RtViewerDemoApplication sampleStoneApplication(broker);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
874
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
875 #if ORTHANC_ENABLE_SDL==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
876 OrthancStone::SdlStoneApplicationRunner sdlApplicationRunner(broker, sampleStoneApplication);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
877 return sdlApplicationRunner.Execute(argc, argv);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
878 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
879 #if ORTHANC_ENABLE_QT==1
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
880 OrthancStone::Samples::SampleQtApplicationRunner qtAppRunner(broker, sampleStoneApplication);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
881 return qtAppRunner.Execute(argc, argv);
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
882 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
883 }
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
884
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
885
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
886 #endif
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
887
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
888
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
889
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
890
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
891
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
892
1d9deb4ee84c Added RTSTRUCT demo viewer based on captain + fix in dev.h (wrong override signature)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
893