diff 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
line wrap: on
line diff
--- a/Framework/Radiography/RadiographySceneReader.h	Tue Jan 14 15:22:10 2020 +0100
+++ b/Framework/Radiography/RadiographySceneReader.h	Tue Jan 21 16:52:37 2020 +0100
@@ -33,6 +33,18 @@
 
 namespace OrthancStone
 {
+  // a layer containing only the geometry of a DICOM layer (bit hacky !)
+  class RadiographyPlaceholderLayer : public RadiographyDicomLayer
+  {
+  public:
+    RadiographyPlaceholderLayer(MessageBroker& broker, const RadiographyScene& scene) :
+      RadiographyDicomLayer(broker, scene)
+    {
+    }
+
+  };
+
+
   // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene
   // from a serialized scene that is passed to web-workers.
   // It needs some architecturing...
@@ -77,7 +89,23 @@
     {
     }
 
-    void Read(const Json::Value& input);
+  protected:
+    virtual RadiographyDicomLayer*  LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);
+  };
+
+  // reads the whole scene but the DICOM image such that we have the full geometry
+  class RadiographySceneGeometryReader : public RadiographySceneBuilder
+  {
+    unsigned int dicomImageWidth_;
+    unsigned int dicomImageHeight_;
+
+  public:
+    RadiographySceneGeometryReader(RadiographyScene& scene, unsigned int dicomImageWidth, unsigned int dicomImageHeight) :
+      RadiographySceneBuilder(scene),
+      dicomImageWidth_(dicomImageWidth),
+      dicomImageHeight_(dicomImageHeight)
+    {
+    }
 
   protected:
     virtual RadiographyDicomLayer*  LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);