diff Framework/Radiography/RadiographySceneReader.cpp @ 1022:1e80a925323a

ReadDicomLayerGeometry
author Alain Mazy <alain@mazy.be>
date Thu, 03 Oct 2019 14:37:52 +0200
parents 238693c3bc51
children 9889c819db01
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