Mercurial > hg > orthanc-wsi
comparison Framework/DicomizerParameters.cpp @ 244:4273518c2009
OrthancWSIDicomizer: Support importing of images from Cytomine
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Dec 2021 21:18:18 +0100 |
parents | 49f647ed1b4c |
children | 793b8f9c9d52 |
comparison
equal
deleted
inserted
replaced
243:7d189530d648 | 244:4273518c2009 |
---|---|
68 pyramidLevelsCount_(0), | 68 pyramidLevelsCount_(0), |
69 pyramidLowerLevelsCount_(0), | 69 pyramidLowerLevelsCount_(0), |
70 smooth_(false), | 70 smooth_(false), |
71 jpegQuality_(90), | 71 jpegQuality_(90), |
72 forceReencode_(false), | 72 forceReencode_(false), |
73 opticalPath_(OpticalPath_Brightfield) | 73 opticalPath_(OpticalPath_Brightfield), |
74 isCytomineSource_(false) | |
74 { | 75 { |
75 backgroundColor_[0] = 255; | 76 backgroundColor_[0] = 255; |
76 backgroundColor_[1] = 255; | 77 backgroundColor_[1] = 255; |
77 backgroundColor_[2] = 255; | 78 backgroundColor_[2] = 255; |
78 threadsCount_ = ChooseNumberOfThreads(); | 79 threadsCount_ = ChooseNumberOfThreads(); |
274 else | 275 else |
275 { | 276 { |
276 return new FolderTarget(folder_ + "/" + folderPattern_); | 277 return new FolderTarget(folder_ + "/" + folderPattern_); |
277 } | 278 } |
278 } | 279 } |
280 | |
281 | |
282 void DicomizerParameters::SetCytomineSource(const std::string& url, | |
283 const std::string& publicKey, | |
284 const std::string& privateKey, | |
285 int imageInstanceId, | |
286 ImageCompression cytomineCompression) | |
287 { | |
288 isCytomineSource_ = true; | |
289 cytomineServer_.SetUrl(url); | |
290 cytominePublicKey_ = publicKey; | |
291 cytominePrivateKey_ = privateKey; | |
292 cytomineImageInstanceId_ = imageInstanceId; | |
293 cytomineCompression_ = cytomineCompression; | |
294 } | |
295 | |
296 | |
297 const Orthanc::WebServiceParameters& DicomizerParameters::GetCytomineServer() const | |
298 { | |
299 if (isCytomineSource_) | |
300 { | |
301 return cytomineServer_; | |
302 } | |
303 else | |
304 { | |
305 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
306 } | |
307 } | |
308 | |
309 | |
310 const std::string& DicomizerParameters::GetCytominePublicKey() const | |
311 { | |
312 if (isCytomineSource_) | |
313 { | |
314 return cytominePublicKey_; | |
315 } | |
316 else | |
317 { | |
318 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
319 } | |
320 } | |
321 | |
322 | |
323 const std::string& DicomizerParameters::GetCytominePrivateKey() const | |
324 { | |
325 if (isCytomineSource_) | |
326 { | |
327 return cytominePrivateKey_; | |
328 } | |
329 else | |
330 { | |
331 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
332 } | |
333 } | |
334 | |
335 | |
336 int DicomizerParameters::GetCytomineImageInstanceId() const | |
337 { | |
338 if (isCytomineSource_) | |
339 { | |
340 return cytomineImageInstanceId_; | |
341 } | |
342 else | |
343 { | |
344 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
345 } | |
346 } | |
347 | |
348 | |
349 ImageCompression DicomizerParameters::GetCytomineCompression() const | |
350 { | |
351 if (isCytomineSource_) | |
352 { | |
353 return cytomineCompression_; | |
354 } | |
355 else | |
356 { | |
357 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
358 } | |
359 } | |
279 } | 360 } |