annotate Framework/Layers/IVolumeSlicer.h @ 621:8adc8cfb50c7

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 May 2019 11:59:46 +0200
parents b70e9be013e4
children f0008c55e5f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
16 *
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "ILayerRenderer.h"
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
25 #include "../Toolbox/Slice.h"
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
26 #include "../../Framework/Messages/IObservable.h"
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
27 #include "../../Framework/Messages/IMessage.h"
318
3a4ca166fafa ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents: 300
diff changeset
28 #include "Core/Images/Image.h"
3a4ca166fafa ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents: 300
diff changeset
29 #include <boost/shared_ptr.hpp>
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
33 class IVolumeSlicer : public IObservable
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 public:
397
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
36 typedef OriginMessage<MessageType_VolumeSlicer_GeometryReady, IVolumeSlicer> GeometryReadyMessage;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
37 typedef OriginMessage<MessageType_VolumeSlicer_GeometryError, IVolumeSlicer> GeometryErrorMessage;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
38 typedef OriginMessage<MessageType_VolumeSlicer_ContentChanged, IVolumeSlicer> ContentChangedMessage;
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 267
diff changeset
39
399
885e1ebd315c rename SliceChange as SliceContentChange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 397
diff changeset
40 class SliceContentChangedMessage : public OriginMessage<MessageType_VolumeSlicer_SliceChanged, IVolumeSlicer>
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
41 {
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
42 private:
252
40b21c1f8b8d more usage of IObservable/IObserver
am@osimis.io
parents: 251
diff changeset
43 const Slice& slice_;
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
44
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
45 public:
399
885e1ebd315c rename SliceChange as SliceContentChange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 397
diff changeset
46 SliceContentChangedMessage(IVolumeSlicer& origin,
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
47 const Slice& slice) :
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
48 OriginMessage(origin),
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
49 slice_(slice)
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
50 {
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
51 }
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
52
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
53 const Slice& GetSlice() const
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
54 {
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
55 return slice_;
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
56 }
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
57 };
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
58
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
59
397
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
60 class LayerReadyMessage : public OriginMessage<MessageType_VolumeSlicer_LayerReady, IVolumeSlicer>
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
62 public:
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
63 class IRendererFactory : public boost::noncopyable
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
64 {
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
65 public:
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
66 virtual ~IRendererFactory()
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
67 {
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
68 }
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
69
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
70 virtual ILayerRenderer* CreateRenderer() const = 0;
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
71 };
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
72
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
73 private:
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
74 const IRendererFactory& factory_;
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
75 const CoordinateSystem3D& slice_;
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
76
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
77 public:
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
78 LayerReadyMessage(IVolumeSlicer& origin,
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
79 const IRendererFactory& rendererFactory,
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
80 const CoordinateSystem3D& slice) :
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
81 OriginMessage(origin),
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
82 factory_(rendererFactory),
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
83 slice_(slice)
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
84 {
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
85 }
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
86
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
87 ILayerRenderer* CreateRenderer() const
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
89 return factory_.CreateRenderer();
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
90 }
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
91
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
92 const CoordinateSystem3D& GetSlice() const
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
93 {
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
94 return slice_;
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
95 }
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
96 };
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
97
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
98
397
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
99 class LayerErrorMessage : public OriginMessage<MessageType_VolumeSlicer_LayerError, IVolumeSlicer>
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
100 {
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
101 private:
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
102 const CoordinateSystem3D& slice_;
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
103
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
104 public:
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
105 LayerErrorMessage(IVolumeSlicer& origin,
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
106 const CoordinateSystem3D& slice) :
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
107 OriginMessage(origin),
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
108 slice_(slice)
379
2308fe0b0b05 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
109 {
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
110 }
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
111
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
112 const CoordinateSystem3D& GetSlice() const
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
113 {
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 379
diff changeset
114 return slice_;
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 }
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 135
diff changeset
116 };
318
3a4ca166fafa ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents: 300
diff changeset
117
378
814fa32e2fcc refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
118
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
119 IVolumeSlicer(MessageBroker& broker) :
378
814fa32e2fcc refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
120 IObservable(broker)
814fa32e2fcc refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
121 {
814fa32e2fcc refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
122 }
814fa32e2fcc refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
123
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
124 virtual ~IVolumeSlicer()
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 {
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
97
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
128 virtual bool GetExtent(std::vector<Vector>& points,
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
129 const CoordinateSystem3D& viewportSlice) = 0;
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
131 virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) = 0;
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 };
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }