annotate Framework/Deprecated/Layers/DicomSeriesVolumeSlicer.cpp @ 1313:f30905f5d246 broker

Added support for OnGenericSdlEvent to GuiAdapter. This makes it possible to piggyback app-specific logic to special events (here, to support the Viewport refresh events)
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 16 Mar 2020 11:12:39 +0100
parents 7ec8fea061b9
children 1a08b779be64
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
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 739
diff changeset
5 * Copyright (C) 2017-2020 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.
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
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
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
22 #include "DicomSeriesVolumeSlicer.h"
65
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 "FrameRenderer.h"
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../Toolbox/DicomFrameConverter.h"
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
212
5412adf19980 resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
27 #include <Core/Logging.h>
5412adf19980 resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
28 #include <Core/OrthancException.h>
113
2eca030792aa using the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
29
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <boost/lexical_cast.hpp>
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
32 namespace Deprecated
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
34
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
35 void DicomSeriesVolumeSlicer::OnSliceGeometryReady(const OrthancSlicesLoader::SliceGeometryReadyMessage& message)
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
647
6af3099ed8da uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 623
diff changeset
37 if (message.GetOrigin().GetSlicesCount() > 0)
266
c9cf95b49a86 removed OrthancSlicesLoader::ISliceLoaderObserver; now using standard messages instead
am@osimis.io
parents: 257
diff changeset
38 {
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
39 BroadcastMessage(IVolumeSlicer::GeometryReadyMessage(*this));
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
40 }
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
41 else
266
c9cf95b49a86 removed OrthancSlicesLoader::ISliceLoaderObserver; now using standard messages instead
am@osimis.io
parents: 257
diff changeset
42 {
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
43 BroadcastMessage(IVolumeSlicer::GeometryErrorMessage(*this));
266
c9cf95b49a86 removed OrthancSlicesLoader::ISliceLoaderObserver; now using standard messages instead
am@osimis.io
parents: 257
diff changeset
44 }
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
45 }
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
47 void DicomSeriesVolumeSlicer::OnSliceGeometryError(const OrthancSlicesLoader::SliceGeometryErrorMessage& message)
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
48 {
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
49 BroadcastMessage(IVolumeSlicer::GeometryErrorMessage(*this));
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
50 }
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
51
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
52
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
53 class DicomSeriesVolumeSlicer::RendererFactory : public LayerReadyMessage::IRendererFactory
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
54 {
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
55 private:
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
56 const OrthancSlicesLoader::SliceImageReadyMessage& message_;
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
57
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
58 public:
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
59 RendererFactory(const OrthancSlicesLoader::SliceImageReadyMessage& message) :
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
60 message_(message)
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
61 {
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
62 }
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
63
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
64 virtual ILayerRenderer* CreateRenderer() const
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
65 {
739
be9c1530d40a deprecating enum SliceImageQuality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
66 bool isFull = (message_.GetEffectiveQuality() == SliceImageQuality_FullPng ||
be9c1530d40a deprecating enum SliceImageQuality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
67 message_.GetEffectiveQuality() == SliceImageQuality_FullPam);
381
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 return FrameRenderer::CreateRenderer(message_.GetImage(), message_.GetSlice(), isFull);
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
70 }
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
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
73 void DicomSeriesVolumeSlicer::OnSliceImageReady(const OrthancSlicesLoader::SliceImageReadyMessage& message)
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
74 {
395
5f13809f3f76 rename ILayerSource::ImageReadyMessage to OrthancFrameLayerSource::FrameReadyMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 381
diff changeset
75 // first notify that the pixel data of the frame is ready (targeted to, i.e: an image cache)
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
76 BroadcastMessage(FrameReadyMessage(*this, message.GetImage(),
395
5f13809f3f76 rename ILayerSource::ImageReadyMessage to OrthancFrameLayerSource::FrameReadyMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 381
diff changeset
77 message.GetEffectiveQuality(), message.GetSlice()));
318
3a4ca166fafa ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents: 300
diff changeset
78
402
72355b637945 removed VolumeSlicerBase
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 401
diff changeset
79 // then notify that the layer is ready for rendering
381
19bd222283ae uncoupling LayerReadyMessage from the creation of the renderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
80 RendererFactory factory(message);
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
81 BroadcastMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, message.GetSlice().GetGeometry()));
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
82 }
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
83
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
84 void DicomSeriesVolumeSlicer::OnSliceImageError(const OrthancSlicesLoader::SliceImageErrorMessage& message)
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
85 {
623
42dadae61fa9 renamed IObservable::EmitMessage() as BroadcastMessage()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
86 BroadcastMessage(IVolumeSlicer::LayerErrorMessage(*this, message.GetSlice().GetGeometry()));
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 268
diff changeset
87 }
98
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
88
395
5f13809f3f76 rename ILayerSource::ImageReadyMessage to OrthancFrameLayerSource::FrameReadyMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 381
diff changeset
89
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
90 DicomSeriesVolumeSlicer::DicomSeriesVolumeSlicer() :
739
be9c1530d40a deprecating enum SliceImageQuality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
91 quality_(SliceImageQuality_FullPng)
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
92 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
93 }
547
0f43e479b49c Removed old rtstruct demo (correct one on its way) + Many warning fixes (mostly 64-bit ?) + reformat + small fixes + indent (breaking long lines)
Benjamin Golinvaux <bgo@osimis.io>
parents: 439
diff changeset
94
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
95 void DicomSeriesVolumeSlicer::Connect(boost::shared_ptr<OrthancApiClient> orthanc)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
96 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
97 loader_.reset(new OrthancSlicesLoader(orthanc));
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
98 Register<OrthancSlicesLoader::SliceGeometryReadyMessage>(*loader_, &DicomSeriesVolumeSlicer::OnSliceGeometryReady);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
99 Register<OrthancSlicesLoader::SliceGeometryErrorMessage>(*loader_, &DicomSeriesVolumeSlicer::OnSliceGeometryError);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
100 Register<OrthancSlicesLoader::SliceImageReadyMessage>(*loader_, &DicomSeriesVolumeSlicer::OnSliceImageReady);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
101 Register<OrthancSlicesLoader::SliceImageErrorMessage>(*loader_, &DicomSeriesVolumeSlicer::OnSliceImageError);
98
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
102 }
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
103
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
104
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
105 void DicomSeriesVolumeSlicer::LoadSeries(const std::string& seriesId)
98
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
106 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
107 if (loader_.get() == NULL)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
108 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
109 // Should have called "Connect()"
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
110 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
111 }
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
112
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
113 loader_->ScheduleLoadSeries(seriesId);
98
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
114 }
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
115
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
116
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
117 void DicomSeriesVolumeSlicer::LoadInstance(const std::string& instanceId)
98
a33abae66344 scrolling over series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
118 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
119 if (loader_.get() == NULL)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
120 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
121 // Should have called "Connect()"
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
122 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
123 }
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
124
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
125 loader_->ScheduleLoadInstance(instanceId);
117
42c05a3baee3 loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
126 }
42c05a3baee3 loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
127
42c05a3baee3 loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
128
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 395
diff changeset
129 void DicomSeriesVolumeSlicer::LoadFrame(const std::string& instanceId,
117
42c05a3baee3 loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
130 unsigned int frame)
42c05a3baee3 loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
131 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
132 if (loader_.get() == NULL)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
133 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
134 // Should have called "Connect()"
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
135 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
136 }
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
137
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
138 loader_->ScheduleLoadFrame(instanceId, frame);
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
139 }
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
140
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
141
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
142 bool DicomSeriesVolumeSlicer::GetExtent(std::vector<OrthancStone::Vector>& points,
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
143 const OrthancStone::CoordinateSystem3D& viewportSlice)
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
145 if (loader_.get() == NULL)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
146 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
147 // Should have called "Connect()"
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
148 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
149 }
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
150
97
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
151 size_t index;
329
b10dfdb96866 removing WorldSceneWidget::IWorldObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 318
diff changeset
152
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
153 if (loader_->IsGeometryReady() &&
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
154 loader_->LookupSlice(index, viewportSlice))
97
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
155 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
156 loader_->GetSlice(index).GetExtent(points);
97
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
157 return true;
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 }
97
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
159 else
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
160 {
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
161 return false;
d18dcc963930 separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 96
diff changeset
162 }
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 }
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
166 void DicomSeriesVolumeSlicer::ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice)
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
168 if (loader_.get() == NULL)
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
169 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
170 // Should have called "Connect()"
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
171 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
172 }
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
173
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
174 size_t index;
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
175
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
176 if (loader_->IsGeometryReady() &&
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
177 loader_->LookupSlice(index, viewportSlice))
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 {
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
179 loader_->ScheduleLoadSliceImage(index, quality_);
65
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 }
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 }
885932a893de OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 }