Mercurial > hg > orthanc
changeset 3908:89ebb37cee6a transcoding
removing leaky abstraction about inplace transcoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 08 May 2020 11:30:32 +0200 |
parents | 1555feda39e2 |
children | 6762a97deabc |
files | Core/DicomParsing/DcmtkTranscoder.h Core/DicomParsing/IDicomTranscoder.h Core/DicomParsing/MemoryBufferTranscoder.cpp Core/DicomParsing/MemoryBufferTranscoder.h |
diffstat | 4 files changed, 4 insertions(+), 96 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/DicomParsing/DcmtkTranscoder.h Fri May 08 11:24:34 2020 +0200 +++ b/Core/DicomParsing/DcmtkTranscoder.h Fri May 08 11:30:32 2020 +0200 @@ -63,16 +63,10 @@ return lossyQuality_; } - virtual bool HasInplaceTranscode(DicomTransferSyntax inputSyntax, - const std::set<DicomTransferSyntax>& outputSyntaxes) const - { - return true; - } - - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set<DicomTransferSyntax>& allowedSyntaxes, - bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; + bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, + DcmFileFormat& dicom, + const std::set<DicomTransferSyntax>& allowedSyntaxes, + bool allowNewSopInstanceUid); virtual bool TranscodeToBuffer(std::string& target, bool& hasSopInstanceUidChanged /* out */,
--- a/Core/DicomParsing/IDicomTranscoder.h Fri May 08 11:24:34 2020 +0200 +++ b/Core/DicomParsing/IDicomTranscoder.h Fri May 08 11:30:32 2020 +0200 @@ -62,19 +62,6 @@ const std::set<DicomTransferSyntax>& allowedSyntaxes, bool allowNewSopInstanceUid) = 0; - virtual bool HasInplaceTranscode(DicomTransferSyntax inputSyntax, - const std::set<DicomTransferSyntax>& outputSyntaxes) const = 0; - - /** - * In-place transcoding. This method is preferred for C-STORE. - **/ - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set<DicomTransferSyntax>& allowedSyntaxes, - bool allowNewSopInstanceUid) = 0; - - - virtual bool TranscodeParsedToBuffer(std::string& target /* out */, DicomTransferSyntax& sourceSyntax /* out */, DicomTransferSyntax& targetSyntax /* out */,
--- a/Core/DicomParsing/MemoryBufferTranscoder.cpp Fri May 08 11:24:34 2020 +0200 +++ b/Core/DicomParsing/MemoryBufferTranscoder.cpp Fri May 08 11:30:32 2020 +0200 @@ -87,68 +87,6 @@ } - bool MemoryBufferTranscoder::HasInplaceTranscode( - DicomTransferSyntax inputSyntax, - const std::set<DicomTransferSyntax>& outputSyntaxes) const - { - /** - * Inplace transcoding is only possible if DCMTK is enabled, and - * if DCMTK supports all the requested transfer - * syntaxes. Otherwise, one has to call the "buffer-to-buffer" - * transcoder. - **/ - -#if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1 - if (useDcmtk_) - { - if (!DcmtkTranscoder::IsSupported(inputSyntax)) - { - return false; - } - - for (std::set<DicomTransferSyntax>::const_iterator - it = outputSyntaxes.begin(); it != outputSyntaxes.end(); ++it) - { - if (!DcmtkTranscoder::IsSupported(*it)) - { - return false; - } - } - - return true; - } - else -#endif - { - return false; - } - } - - - bool MemoryBufferTranscoder::InplaceTranscode(bool& hasSopInstanceUidChanged, - DcmFileFormat& dicom, - const std::set<DicomTransferSyntax>& allowedSyntaxes, - bool allowNewSopInstanceUid) - { -#if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1 - DicomTransferSyntax inputSyntax; - if (useDcmtk_ && - FromDcmtkBridge::LookupOrthancTransferSyntax(inputSyntax, dicom) && - HasInplaceTranscode(inputSyntax, allowedSyntaxes)) - { - return dcmtk_.InplaceTranscode(hasSopInstanceUidChanged, dicom, allowedSyntaxes, allowNewSopInstanceUid); - } - else -#endif - { - // "HasInplaceTranscode()" should have been called - throw OrthancException(ErrorCode_BadSequenceOfCalls); - } - } - - - - bool MemoryBufferTranscoder::TranscodeParsedToBuffer( std::string& target /* out */, DicomTransferSyntax& sourceSyntax /* out */,
--- a/Core/DicomParsing/MemoryBufferTranscoder.h Fri May 08 11:24:34 2020 +0200 +++ b/Core/DicomParsing/MemoryBufferTranscoder.h Fri May 08 11:30:32 2020 +0200 @@ -84,17 +84,6 @@ const std::set<DicomTransferSyntax>& allowedSyntaxes, bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; - virtual bool HasInplaceTranscode( - DicomTransferSyntax inputSyntax, - const std::set<DicomTransferSyntax>& outputSyntaxes) const ORTHANC_OVERRIDE; - - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set<DicomTransferSyntax>& allowedSyntaxes, - bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; - - - virtual bool TranscodeParsedToBuffer(std::string& target /* out */, DicomTransferSyntax& sourceSyntax /* out */, DicomTransferSyntax& targetSyntax /* out */,