comparison 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
comparison
equal deleted inserted replaced
1015:24fecc02bfb1 1022:1e80a925323a
138 else 138 else
139 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); 139 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
140 } 140 }
141 } 141 }
142 142
143
144 void RadiographySceneReader::Read(const Json::Value& input) 143 void RadiographySceneReader::Read(const Json::Value& input)
145 { 144 {
146 unsigned int version = input["version"].asUInt(); 145 unsigned int version = input["version"].asUInt();
147 146
148 if (version != 1) 147 if (version != 1)
223 layer.SetForegroundValue((float)(jsonLayer["foreground"].asDouble())); 222 layer.SetForegroundValue((float)(jsonLayer["foreground"].asDouble()));
224 } 223 }
225 } 224 }
226 else 225 else
227 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); 226 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
227 }
228 }
229
230 void RadiographySceneBuilder::ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input)
231 {
232 for(size_t layerIndex = 0; layerIndex < input["layers"].size(); layerIndex++)
233 {
234 const Json::Value& jsonLayer = input["layers"][(int)layerIndex];
235 RadiographyLayer::Geometry geometry;
236 if (jsonLayer["type"].asString() == "dicom")
237 {
238 ReadLayerGeometry(geometry, jsonLayer);
239 return;
240 }
228 } 241 }
229 } 242 }
230 243
231 void RadiographySceneBuilder::ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& jsonLayer) 244 void RadiographySceneBuilder::ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& jsonLayer)
232 { 245 {