comparison Plugins/Engine/OrthancPlugins.cpp @ 3980:e42f5445d20d

Fix decoding of DICOM images for plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 May 2020 09:04:00 +0200
parents 821715370890
children 4cd94ed75a5b
comparison
equal deleted inserted replaced
3979:464d40d572bd 3980:e42f5445d20d
2920 break; 2920 break;
2921 } 2921 }
2922 2922
2923 case OrthancPluginImageFormat_Dicom: 2923 case OrthancPluginImageFormat_Dicom:
2924 { 2924 {
2925 image.reset(Decode(p.data, p.size, 0)); 2925 PImpl::ServerContextLock lock(*pimpl_);
2926 image.reset(lock.GetContext().DecodeDicomFrame(p.data, p.size, 0));
2926 break; 2927 break;
2927 } 2928 }
2928 2929
2929 default: 2930 default:
2930 throw OrthancException(ErrorCode_ParameterOutOfRange); 2931 throw OrthancException(ErrorCode_ParameterOutOfRange);
3483 result->AssignWritable(Plugins::Convert(p.format), p.width, p.height, p.pitch, p.buffer); 3484 result->AssignWritable(Plugins::Convert(p.format), p.width, p.height, p.pitch, p.buffer);
3484 break; 3485 break;
3485 3486
3486 case _OrthancPluginService_DecodeDicomImage: 3487 case _OrthancPluginService_DecodeDicomImage:
3487 { 3488 {
3488 result.reset(Decode(p.constBuffer, p.bufferSize, p.frameIndex)); 3489 PImpl::ServerContextLock lock(*pimpl_);
3490 result.reset(lock.GetContext().DecodeDicomFrame(p.constBuffer, p.bufferSize, p.frameIndex));
3489 break; 3491 break;
3490 } 3492 }
3491 3493
3492 default: 3494 default:
3493 throw OrthancException(ErrorCode_InternalError); 3495 throw OrthancException(ErrorCode_InternalError);