Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.cpp @ 3944:aae045f802f4 transcoding
preparing simplified interface for IDicomTranscoder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 19 May 2020 10:17:06 +0200 |
parents | 771dbd9eb3bd |
children | 0b3256c3ee14 |
comparison
equal
deleted
inserted
replaced
3943:b26d25d3c1c7 | 3944:aae045f802f4 |
---|---|
1411 else | 1411 else |
1412 { | 1412 { |
1413 return NULL; | 1413 return NULL; |
1414 } | 1414 } |
1415 } | 1415 } |
1416 | |
1417 | |
1418 bool ServerContext::Transcode(DicomImage& target, | |
1419 bool& hasSopInstanceUidChanged /* out */, | |
1420 DicomImage& source /* in, "GetParsed()" possibly modified */, | |
1421 const std::set<DicomTransferSyntax>& allowedSyntaxes, | |
1422 bool allowNewSopInstanceUid) | |
1423 { | |
1424 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_Before) | |
1425 { | |
1426 if (dcmtkTranscoder_->Transcode(target, hasSopInstanceUidChanged, source, | |
1427 allowedSyntaxes, allowNewSopInstanceUid)) | |
1428 { | |
1429 return true; | |
1430 } | |
1431 } | |
1432 | |
1433 #if ORTHANC_ENABLE_PLUGINS == 1 | |
1434 if (HasPlugins() && | |
1435 GetPlugins().HasCustomTranscoder()) | |
1436 { | |
1437 if (GetPlugins().Transcode(target, hasSopInstanceUidChanged, source, | |
1438 allowedSyntaxes, allowNewSopInstanceUid)) | |
1439 { | |
1440 return true; | |
1441 } | |
1442 else if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_After) | |
1443 { | |
1444 LOG(INFO) << "The installed transcoding plugins cannot handle an image, " | |
1445 << "fallback to the built-in DCMTK transcoder"; | |
1446 } | |
1447 } | |
1448 #endif | |
1449 | |
1450 if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_After) | |
1451 { | |
1452 return dcmtkTranscoder_->Transcode(target, hasSopInstanceUidChanged, source, | |
1453 allowedSyntaxes, allowNewSopInstanceUid); | |
1454 } | |
1455 else | |
1456 { | |
1457 return false; | |
1458 } | |
1459 } | |
1416 } | 1460 } |