comparison OrthancServer/main.cpp @ 291:4d7469f72a0b

embedding of dicom dictionaries
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Dec 2012 15:15:48 +0100
parents e6a4c4329481
children b9bc31c6b639
comparison
equal deleted inserted replaced
290:b3322636b06d 291:4d7469f72a0b
56 MyDicomStore(ServerContext& context) : 56 MyDicomStore(ServerContext& context) :
57 context_(context) 57 context_(context)
58 { 58 {
59 } 59 }
60 60
61 virtual void Handle(const std::vector<uint8_t>& dicomFile, 61 virtual void Handle(const std::string& dicomFile,
62 const DicomMap& dicomSummary, 62 const DicomMap& dicomSummary,
63 const Json::Value& dicomJson, 63 const Json::Value& dicomJson,
64 const std::string& remoteAet) 64 const std::string& remoteAet)
65 { 65 {
66 if (dicomFile.size() > 0) 66 if (dicomFile.size() > 0)
67 { 67 {
68 context_.Store(reinterpret_cast<const char*>(&dicomFile[0]), dicomFile.size(), 68 context_.Store(&dicomFile[0], dicomFile.size(), dicomSummary, dicomJson, remoteAet);
69 dicomSummary, dicomJson, remoteAet);
70 } 69 }
71 } 70 }
72 }; 71 };
73 72
74 73
185 } 184 }
186 } 185 }
187 186
188 google::InitGoogleLogging("Orthanc"); 187 google::InitGoogleLogging("Orthanc");
189 188
190 189 int status = 0;
191 try 190 try
192 { 191 {
193 bool isInitialized = false; 192 bool isInitialized = false;
194 if (argc >= 2) 193 if (argc >= 2)
195 { 194 {
287 storeScp.Done(); 286 storeScp.Done();
288 } 287 }
289 catch (OrthancException& e) 288 catch (OrthancException& e)
290 { 289 {
291 LOG(ERROR) << "EXCEPTION [" << e.What() << "]"; 290 LOG(ERROR) << "EXCEPTION [" << e.What() << "]";
292 return -1; 291 status = -1;
292 }
293 catch (...)
294 {
295 LOG(ERROR) << "NATIVE EXCEPTION";
296 status = -1;
293 } 297 }
294 298
295 OrthancFinalize(); 299 OrthancFinalize();
296 300
297 return 0; 301 return status;
298 } 302 }