# HG changeset patch # User Alain Mazy # Date 1570106272 -7200 # Node ID 1e80a925323a6f94f642ea3e2e854055e23cf136 # Parent 24fecc02bfb15f8ea2277873140540117bbae091 ReadDicomLayerGeometry diff -r 24fecc02bfb1 -r 1e80a925323a Framework/Radiography/RadiographySceneReader.cpp --- 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 diff -r 24fecc02bfb1 -r 1e80a925323a Framework/Radiography/RadiographySceneReader.h --- 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); + };