# HG changeset patch # User Sebastien Jodogne # Date 1588930232 -7200 # Node ID 89ebb37cee6ae505aff1e9e54183ee9dbf1f9820 # Parent 1555feda39e2c63febc3840831e55b815fb8544f removing leaky abstraction about inplace transcoding diff -r 1555feda39e2 -r 89ebb37cee6a Core/DicomParsing/DcmtkTranscoder.h --- 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& outputSyntaxes) const - { - return true; - } - - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set& allowedSyntaxes, - bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; + bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, + DcmFileFormat& dicom, + const std::set& allowedSyntaxes, + bool allowNewSopInstanceUid); virtual bool TranscodeToBuffer(std::string& target, bool& hasSopInstanceUidChanged /* out */, diff -r 1555feda39e2 -r 89ebb37cee6a Core/DicomParsing/IDicomTranscoder.h --- 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& allowedSyntaxes, bool allowNewSopInstanceUid) = 0; - virtual bool HasInplaceTranscode(DicomTransferSyntax inputSyntax, - const std::set& outputSyntaxes) const = 0; - - /** - * In-place transcoding. This method is preferred for C-STORE. - **/ - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set& allowedSyntaxes, - bool allowNewSopInstanceUid) = 0; - - - virtual bool TranscodeParsedToBuffer(std::string& target /* out */, DicomTransferSyntax& sourceSyntax /* out */, DicomTransferSyntax& targetSyntax /* out */, diff -r 1555feda39e2 -r 89ebb37cee6a Core/DicomParsing/MemoryBufferTranscoder.cpp --- 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& 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::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& 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 */, diff -r 1555feda39e2 -r 89ebb37cee6a Core/DicomParsing/MemoryBufferTranscoder.h --- 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& allowedSyntaxes, bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; - virtual bool HasInplaceTranscode( - DicomTransferSyntax inputSyntax, - const std::set& outputSyntaxes) const ORTHANC_OVERRIDE; - - virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */, - DcmFileFormat& dicom, - const std::set& allowedSyntaxes, - bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; - - - virtual bool TranscodeParsedToBuffer(std::string& target /* out */, DicomTransferSyntax& sourceSyntax /* out */, DicomTransferSyntax& targetSyntax /* out */,