Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographySceneReader.h @ 1259:69177b10e2b9
various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 21 Jan 2020 16:52:37 +0100 |
parents | f417a0ae282b |
children | 7ec8fea061b9 1c7ae79c426d |
comparison
equal
deleted
inserted
replaced
1258:9c20ae049669 | 1259:69177b10e2b9 |
---|---|
31 #include <json/value.h> | 31 #include <json/value.h> |
32 #include <Core/Images/FontRegistry.h> | 32 #include <Core/Images/FontRegistry.h> |
33 | 33 |
34 namespace OrthancStone | 34 namespace OrthancStone |
35 { | 35 { |
36 // a layer containing only the geometry of a DICOM layer (bit hacky !) | |
37 class RadiographyPlaceholderLayer : public RadiographyDicomLayer | |
38 { | |
39 public: | |
40 RadiographyPlaceholderLayer(MessageBroker& broker, const RadiographyScene& scene) : | |
41 RadiographyDicomLayer(broker, scene) | |
42 { | |
43 } | |
44 | |
45 }; | |
46 | |
47 | |
36 // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene | 48 // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene |
37 // from a serialized scene that is passed to web-workers. | 49 // from a serialized scene that is passed to web-workers. |
38 // It needs some architecturing... | 50 // It needs some architecturing... |
39 class RadiographySceneBuilder : public boost::noncopyable | 51 class RadiographySceneBuilder : public boost::noncopyable |
40 { | 52 { |
75 RadiographySceneBuilder(scene), | 87 RadiographySceneBuilder(scene), |
76 orthancApiClient_(orthancApiClient) | 88 orthancApiClient_(orthancApiClient) |
77 { | 89 { |
78 } | 90 } |
79 | 91 |
80 void Read(const Json::Value& input); | 92 protected: |
93 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry); | |
94 }; | |
95 | |
96 // reads the whole scene but the DICOM image such that we have the full geometry | |
97 class RadiographySceneGeometryReader : public RadiographySceneBuilder | |
98 { | |
99 unsigned int dicomImageWidth_; | |
100 unsigned int dicomImageHeight_; | |
101 | |
102 public: | |
103 RadiographySceneGeometryReader(RadiographyScene& scene, unsigned int dicomImageWidth, unsigned int dicomImageHeight) : | |
104 RadiographySceneBuilder(scene), | |
105 dicomImageWidth_(dicomImageWidth), | |
106 dicomImageHeight_(dicomImageHeight) | |
107 { | |
108 } | |
81 | 109 |
82 protected: | 110 protected: |
83 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry); | 111 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry); |
84 }; | 112 }; |
85 } | 113 } |