Mercurial > hg > orthanc-wsi
comparison ViewerPlugin/Plugin.cpp @ 150:442102e14933
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jul 2018 09:55:24 +0200 |
parents | 0b7e7be7d655 |
children | fb8d4cd2f618 b798d200ac90 |
comparison
equal
deleted
inserted
replaced
149:954f45b6e60c | 150:442102e14933 |
---|---|
21 | 21 |
22 #include "../Framework/PrecompiledHeadersWSI.h" | 22 #include "../Framework/PrecompiledHeadersWSI.h" |
23 | 23 |
24 #include "DicomPyramidCache.h" | 24 #include "DicomPyramidCache.h" |
25 #include "../Framework/Jpeg2000Reader.h" | 25 #include "../Framework/Jpeg2000Reader.h" |
26 #include "../Framework/Semaphore.h" | |
26 | 27 |
27 #include <Core/Images/ImageProcessing.h> | 28 #include <Core/Images/ImageProcessing.h> |
28 #include <Core/Images/PngWriter.h> | 29 #include <Core/Images/PngWriter.h> |
29 #include <Core/MultiThreading/Semaphore.h> | |
30 #include <Core/OrthancException.h> | 30 #include <Core/OrthancException.h> |
31 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> | 31 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> |
32 #include <Plugins/Samples/Common/OrthancPluginConnection.h> | 32 #include <Plugins/Samples/Common/OrthancPluginConnection.h> |
33 | 33 |
34 #include <EmbeddedResources.h> | 34 #include <EmbeddedResources.h> |
37 | 37 |
38 OrthancPluginContext* context_ = NULL; | 38 OrthancPluginContext* context_ = NULL; |
39 | 39 |
40 std::auto_ptr<OrthancPlugins::OrthancPluginConnection> orthanc_; | 40 std::auto_ptr<OrthancPlugins::OrthancPluginConnection> orthanc_; |
41 std::auto_ptr<OrthancWSI::DicomPyramidCache> cache_; | 41 std::auto_ptr<OrthancWSI::DicomPyramidCache> cache_; |
42 std::auto_ptr<Orthanc::Semaphore> transcoderSemaphore_; | 42 std::auto_ptr<OrthancWSI::Semaphore> transcoderSemaphore_; |
43 | 43 |
44 | 44 |
45 static void AnswerSparseTile(OrthancPluginRestOutput* output, | 45 static void AnswerSparseTile(OrthancPluginRestOutput* output, |
46 unsigned int tileWidth, | 46 unsigned int tileWidth, |
47 unsigned int tileHeight) | 47 unsigned int tileHeight) |
181 | 181 |
182 // The tile does not come from a DICOM-JPEG instance, we need to | 182 // The tile does not come from a DICOM-JPEG instance, we need to |
183 // decompress the raw tile | 183 // decompress the raw tile |
184 std::auto_ptr<Orthanc::ImageAccessor> decoded; | 184 std::auto_ptr<Orthanc::ImageAccessor> decoded; |
185 | 185 |
186 Orthanc::Semaphore::Locker locker(*transcoderSemaphore_); | 186 OrthancWSI::Semaphore::Locker locker(*transcoderSemaphore_); |
187 | 187 |
188 switch (compression) | 188 switch (compression) |
189 { | 189 { |
190 case OrthancWSI::ImageCompression_Jpeg2000: | 190 case OrthancWSI::ImageCompression_Jpeg2000: |
191 decoded.reset(new OrthancWSI::Jpeg2000Reader); | 191 decoded.reset(new OrthancWSI::Jpeg2000Reader); |
317 if (threads <= 0) | 317 if (threads <= 0) |
318 { | 318 { |
319 threads = 1; | 319 threads = 1; |
320 } | 320 } |
321 | 321 |
322 transcoderSemaphore_.reset(new Orthanc::Semaphore(threads)); | 322 transcoderSemaphore_.reset(new OrthancWSI::Semaphore(threads)); |
323 | 323 |
324 char info[1024]; | 324 char info[1024]; |
325 sprintf(info, "The whole-slide imaging plugin will use at most %u threads to transcode the tiles", threads); | 325 sprintf(info, "The whole-slide imaging plugin will use at most %u threads to transcode the tiles", threads); |
326 OrthancPluginLogWarning(context_, info); | 326 OrthancPluginLogWarning(context_, info); |
327 | 327 |