comparison Framework/Layers/DicomSeriesVolumeSlicer.h @ 726:4f2416d519b4

moving layers, widgets and loaders to Deprecated namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 11:43:25 +0200
parents d2c0e347ddc2
children
comparison
equal deleted inserted replaced
714:d2c0e347ddc2 726:4f2416d519b4
24 #include "IVolumeSlicer.h" 24 #include "IVolumeSlicer.h"
25 #include "../Toolbox/IWebService.h" 25 #include "../Toolbox/IWebService.h"
26 #include "../Toolbox/OrthancSlicesLoader.h" 26 #include "../Toolbox/OrthancSlicesLoader.h"
27 #include "../Toolbox/OrthancApiClient.h" 27 #include "../Toolbox/OrthancApiClient.h"
28 28
29 namespace OrthancStone 29 namespace Deprecated
30 { 30 {
31 // this class is in charge of loading a Frame. 31 // this class is in charge of loading a Frame.
32 // once it's been loaded (first the geometry and then the image), 32 // once it's been loaded (first the geometry and then the image),
33 // messages are sent to observers so they can use it 33 // messages are sent to observers so they can use it
34 class DicomSeriesVolumeSlicer : 34 class DicomSeriesVolumeSlicer :
35 public IVolumeSlicer, 35 public IVolumeSlicer,
36 public IObserver 36 public OrthancStone::IObserver
37 //private OrthancSlicesLoader::ISliceLoaderObserver 37 //private OrthancSlicesLoader::ISliceLoaderObserver
38 { 38 {
39 public: 39 public:
40 // TODO: Add "frame" and "instanceId" 40 // TODO: Add "frame" and "instanceId"
41 class FrameReadyMessage : public OriginMessage<DicomSeriesVolumeSlicer> 41 class FrameReadyMessage : public OrthancStone::OriginMessage<DicomSeriesVolumeSlicer>
42 { 42 {
43 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); 43 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
44 44
45 private: 45 private:
46 const Orthanc::ImageAccessor& frame_; 46 const Orthanc::ImageAccessor& frame_;
47 SliceImageQuality imageQuality_; 47 OrthancStone::SliceImageQuality imageQuality_;
48 const Deprecated::Slice& slice_; 48 const Slice& slice_;
49 49
50 public: 50 public:
51 FrameReadyMessage(DicomSeriesVolumeSlicer& origin, 51 FrameReadyMessage(DicomSeriesVolumeSlicer& origin,
52 const Orthanc::ImageAccessor& frame, 52 const Orthanc::ImageAccessor& frame,
53 SliceImageQuality imageQuality, 53 OrthancStone::SliceImageQuality imageQuality,
54 const Deprecated::Slice& slice) : 54 const Slice& slice) :
55 OriginMessage(origin), 55 OriginMessage(origin),
56 frame_(frame), 56 frame_(frame),
57 imageQuality_(imageQuality), 57 imageQuality_(imageQuality),
58 slice_(slice) 58 slice_(slice)
59 { 59 {
62 const Orthanc::ImageAccessor& GetFrame() const 62 const Orthanc::ImageAccessor& GetFrame() const
63 { 63 {
64 return frame_; 64 return frame_;
65 } 65 }
66 66
67 SliceImageQuality GetImageQuality() const 67 OrthancStone::SliceImageQuality GetImageQuality() const
68 { 68 {
69 return imageQuality_; 69 return imageQuality_;
70 } 70 }
71 71
72 const Deprecated::Slice& GetSlice() const 72 const Slice& GetSlice() const
73 { 73 {
74 return slice_; 74 return slice_;
75 } 75 }
76 }; 76 };
77 77
78 78
79 private: 79 private:
80 class RendererFactory; 80 class RendererFactory;
81 81
82 OrthancSlicesLoader loader_; 82 OrthancSlicesLoader loader_;
83 SliceImageQuality quality_; 83 OrthancStone::SliceImageQuality quality_;
84 84
85 public: 85 public:
86 DicomSeriesVolumeSlicer(MessageBroker& broker, OrthancApiClient& orthanc); 86 DicomSeriesVolumeSlicer(OrthancStone::MessageBroker& broker,
87 OrthancApiClient& orthanc);
87 88
88 void LoadSeries(const std::string& seriesId); 89 void LoadSeries(const std::string& seriesId);
89 90
90 void LoadInstance(const std::string& instanceId); 91 void LoadInstance(const std::string& instanceId);
91 92
92 void LoadFrame(const std::string& instanceId, 93 void LoadFrame(const std::string& instanceId,
93 unsigned int frame); 94 unsigned int frame);
94 95
95 void SetImageQuality(SliceImageQuality quality) 96 void SetImageQuality(OrthancStone::SliceImageQuality quality)
96 { 97 {
97 quality_ = quality; 98 quality_ = quality;
98 } 99 }
99 100
100 SliceImageQuality GetImageQuality() const 101 OrthancStone::SliceImageQuality GetImageQuality() const
101 { 102 {
102 return quality_; 103 return quality_;
103 } 104 }
104 105
105 size_t GetSlicesCount() const 106 size_t GetSlicesCount() const
106 { 107 {
107 return loader_.GetSlicesCount(); 108 return loader_.GetSlicesCount();
108 } 109 }
109 110
110 const Deprecated::Slice& GetSlice(size_t slice) const 111 const Slice& GetSlice(size_t slice) const
111 { 112 {
112 return loader_.GetSlice(slice); 113 return loader_.GetSlice(slice);
113 } 114 }
114 115
115 virtual bool GetExtent(std::vector<Vector>& points, 116 virtual bool GetExtent(std::vector<OrthancStone::Vector>& points,
116 const CoordinateSystem3D& viewportSlice); 117 const OrthancStone::CoordinateSystem3D& viewportSlice);
117 118
118 virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice); 119 virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice);
119 120
120 protected: 121 protected:
121 void OnSliceGeometryReady(const OrthancSlicesLoader::SliceGeometryReadyMessage& message); 122 void OnSliceGeometryReady(const OrthancSlicesLoader::SliceGeometryReadyMessage& message);
122 void OnSliceGeometryError(const OrthancSlicesLoader::SliceGeometryErrorMessage& message); 123 void OnSliceGeometryError(const OrthancSlicesLoader::SliceGeometryErrorMessage& message);
123 void OnSliceImageReady(const OrthancSlicesLoader::SliceImageReadyMessage& message); 124 void OnSliceImageReady(const OrthancSlicesLoader::SliceImageReadyMessage& message);