changeset 1022:1e80a925323a

ReadDicomLayerGeometry
author Alain Mazy <alain@mazy.be>
date Thu, 03 Oct 2019 14:37:52 +0200
parents 24fecc02bfb1
children 701f36c28193
files Framework/Radiography/RadiographySceneReader.cpp Framework/Radiography/RadiographySceneReader.h
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Radiography/RadiographySceneReader.cpp	Tue Sep 24 11:16:25 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.cpp	Thu Oct 03 14:37:52 2019 +0200
@@ -140,7 +140,6 @@
     }
   }
 
-
   void RadiographySceneReader::Read(const Json::Value& input)
   {
     unsigned int version = input["version"].asUInt();
@@ -228,6 +227,20 @@
     }
   }
 
+  void RadiographySceneBuilder::ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input)
+  {
+    for(size_t layerIndex = 0; layerIndex < input["layers"].size(); layerIndex++)
+    {
+      const Json::Value& jsonLayer = input["layers"][(int)layerIndex];
+      RadiographyLayer::Geometry geometry;
+      if (jsonLayer["type"].asString() == "dicom")
+      {
+        ReadLayerGeometry(geometry, jsonLayer);
+        return;
+      }
+    }
+  }
+
   void RadiographySceneBuilder::ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& jsonLayer)
   {
     {// crop
--- a/Framework/Radiography/RadiographySceneReader.h	Tue Sep 24 11:16:25 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.h	Thu Oct 03 14:37:52 2019 +0200
@@ -64,9 +64,12 @@
       fontRegistry_ = &fontRegistry;
     }
 
+    static void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
+    static void ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
+
   protected:
-    void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
     virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);
+
   };