comparison Core/DicomParsing/MemoryBufferTranscoder.h @ 3894:8f7ad4989fec transcoding

transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 May 2020 11:13:29 +0200
parents 7a5fa8f307e9
children c62f84c7eda9
comparison
equal deleted inserted replaced
3893:7a5fa8f307e9 3894:8f7ad4989fec
45 { 45 {
46 // This is the basis class for transcoding plugins 46 // This is the basis class for transcoding plugins
47 class MemoryBufferTranscoder : public IDicomTranscoder 47 class MemoryBufferTranscoder : public IDicomTranscoder
48 { 48 {
49 private: 49 private:
50 bool tryDcmtk_; 50 bool useDcmtk_;
51 51
52 #if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1 52 #if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1
53 DcmtkTranscoder dcmtk_; 53 DcmtkTranscoder dcmtk_;
54 #endif 54 #endif
55 55
56 protected: 56 protected:
57 virtual bool Transcode(std::string& target, 57 virtual bool Transcode(std::string& target,
58 bool& hasSopInstanceUidChanged /* out */,
58 const void* buffer, 59 const void* buffer,
59 size_t size, 60 size_t size,
60 const std::set<DicomTransferSyntax>& allowedSyntaxes, 61 const std::set<DicomTransferSyntax>& allowedSyntaxes,
61 bool allowNewSopInstanceUid) = 0; 62 bool allowNewSopInstanceUid) = 0;
62 63
63 public: 64 public:
64 /** 65 /**
65 * If "tryDcmtk" is "true", the transcoder will first try and call 66 * If "useDcmtk" is "true", the transcoder will first try and call
66 * DCMTK, before calling its own "Transcode()" implementation. 67 * DCMTK, before calling its own "Transcode()" implementation.
67 **/ 68 **/
68 MemoryBufferTranscoder(bool tryDcmtk); 69 MemoryBufferTranscoder();
70
71 void SetDcmtkUsed(bool used);
72
73 bool IsDcmtkUsed() const
74 {
75 return useDcmtk_;
76 }
69 77
70 virtual bool TranscodeToBuffer(std::string& target, 78 virtual bool TranscodeToBuffer(std::string& target,
79 bool& hasSopInstanceUidChanged /* out */,
71 const void* buffer, 80 const void* buffer,
72 size_t size, 81 size_t size,
73 const std::set<DicomTransferSyntax>& allowedSyntaxes, 82 const std::set<DicomTransferSyntax>& allowedSyntaxes,
74 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; 83 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE;
75 84
76 virtual DcmFileFormat* TranscodeToParsed(const void* buffer, 85 virtual DcmFileFormat* TranscodeToParsed(bool& hasSopInstanceUidChanged /* out */,
86 const void* buffer,
77 size_t size, 87 size_t size,
78 const std::set<DicomTransferSyntax>& allowedSyntaxes, 88 const std::set<DicomTransferSyntax>& allowedSyntaxes,
79 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; 89 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE;
80 90
81 virtual bool HasInplaceTranscode() const ORTHANC_OVERRIDE 91 virtual bool HasInplaceTranscode() const ORTHANC_OVERRIDE
82 { 92 {
83 return tryDcmtk_; 93 return useDcmtk_;
84 } 94 }
85 95
86 virtual bool InplaceTranscode(DcmFileFormat& dicom, 96 virtual bool InplaceTranscode(bool& hasSopInstanceUidChanged /* out */,
97 DcmFileFormat& dicom,
87 const std::set<DicomTransferSyntax>& allowedSyntaxes, 98 const std::set<DicomTransferSyntax>& allowedSyntaxes,
88 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; 99 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE;
89 }; 100 };
90 } 101 }