comparison Plugin/Plugin.cpp @ 96:a6ba21a083e5 refactoring

major refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Nov 2015 18:26:55 +0100
parents dbe7c97b6b4a
children 46ec13a1177c
comparison
equal deleted inserted replaced
95:dbe7c97b6b4a 96:a6ba21a083e5
325 const uint32_t size, 325 const uint32_t size,
326 uint32_t frameIndex) 326 uint32_t frameIndex)
327 { 327 {
328 try 328 try
329 { 329 {
330 #if 1 330 std::auto_ptr<OrthancPlugins::OrthancImageWrapper> image;
331
332 #if 0
331 // Do not use the cache 333 // Do not use the cache
332 OrthancPlugins::GdcmImageDecoder decoder(dicom, size); 334 OrthancPlugins::GdcmImageDecoder decoder(dicom, size);
333 *target = decoder.Decode(context_, frameIndex); 335 image.reset(new OrthancPlugins::OrthancImageWrapper(context_, decoder, frameIndex));
334 #else 336 #else
335 *target = cache_.Decode(context_, dicom, size, frameIndex); 337 using namespace OrthancPlugins;
338 ICacheFactory& factory = cache_->GetScheduler().GetFactory(CacheBundle_DecodedImage);
339 image.reset(dynamic_cast<DecodedImageAdapter&>(factory).GetDecoderCache().Decode(context_, dicom, size, frameIndex));
336 #endif 340 #endif
341
342 *target = image->Release();
337 343
338 return OrthancPluginErrorCode_Success; 344 return OrthancPluginErrorCode_Success;
339 } 345 }
340 catch (std::runtime_error& e) 346 catch (std::runtime_error& e)
341 { 347 {