comparison Framework/Layers/DicomStructureSetRendererFactory.cpp @ 128:c993693e9e63 wasm

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 14 Nov 2017 17:26:10 +0100
parents c9e88e7935a4
children a823122db53d
comparison
equal deleted inserted replaced
127:b963f3a9a86c 128:c993693e9e63
162 structureSet_->GetReferencedInstances(instances); 162 structureSet_->GetReferencedInstances(instances);
163 163
164 for (std::set<std::string>::const_iterator it = instances.begin(); 164 for (std::set<std::string>::const_iterator it = instances.begin();
165 it != instances.end(); ++it) 165 it != instances.end(); ++it)
166 { 166 {
167 orthanc_.SchedulePostRequest(*this, "/tools/lookup", *it, 167 orthanc_.SchedulePostRequest(loader_, "/tools/lookup", *it,
168 new Operation(Operation::Type_LookupSopInstanceUid, *it)); 168 new Operation(Operation::Type_LookupSopInstanceUid, *it));
169 } 169 }
170 170
171 break; 171 break;
172 } 172 }
187 { 187 {
188 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 188 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
189 } 189 }
190 190
191 const std::string& instance = lookup[0]["ID"].asString(); 191 const std::string& instance = lookup[0]["ID"].asString();
192 orthanc_.ScheduleGetRequest(*this, "/instances/" + instance + "/tags", 192 orthanc_.ScheduleGetRequest(loader_, "/instances/" + instance + "/tags",
193 new Operation(Operation::Type_LoadReferencedSlice, instance)); 193 new Operation(Operation::Type_LoadReferencedSlice, instance));
194 } 194 }
195 else 195 else
196 { 196 {
197 // TODO 197 // TODO
217 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 217 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
218 } 218 }
219 } 219 }
220 220
221 221
222 DicomStructureSetRendererFactory::DicomStructureSetRendererFactory(IWebService& orthanc, 222 DicomStructureSetRendererFactory::DicomStructureSetRendererFactory(IWebService& orthanc) :
223 const std::string& instance) : 223 loader_(*this),
224 orthanc_(orthanc) 224 orthanc_(orthanc)
225 { 225 {
226 const std::string uri = "/instances/" + instance + "/tags?ignore-length=3006-0050"; 226 }
227 orthanc_.ScheduleGetRequest(*this, uri, new Operation(Operation::Type_LoadStructureSet, instance)); 227
228 } 228
229 229 void DicomStructureSetRendererFactory::ScheduleLoadInstance(const std::string& instance)
230 230 {
231 if (structureSet_.get() != NULL)
232 {
233 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
234 }
235 else
236 {
237 const std::string uri = "/instances/" + instance + "/tags?ignore-length=3006-0050";
238 orthanc_.ScheduleGetRequest(loader_, uri, new Operation(Operation::Type_LoadStructureSet, instance));
239 }
240 }
241
242
231 void DicomStructureSetRendererFactory::ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) 243 void DicomStructureSetRendererFactory::ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice)
232 { 244 {
233 if (structureSet_.get() != NULL) 245 if (structureSet_.get() != NULL)
234 { 246 {
235 NotifyLayerReady(new Renderer(*structureSet_, viewportSlice), viewportSlice, false); 247 NotifyLayerReady(new Renderer(*structureSet_, viewportSlice), viewportSlice, false);