Mercurial > hg > orthanc
changeset 3770:66e18aad0654 transcoding
integration mainline->transcoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Mar 2020 16:39:38 +0100 |
parents | 711d2ec2db34 (current diff) eb044cc49d51 (diff) |
children | a11d1d4b5849 |
files | Core/DicomParsing/FromDcmtkBridge.cpp UnitTestsSources/FromDcmtkTests.cpp |
diffstat | 22 files changed, 297 insertions(+), 81 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/Compatibility.h Tue Mar 17 13:11:44 2020 +0100 +++ b/Core/Compatibility.h Tue Mar 17 16:39:38 2020 +0100 @@ -93,7 +93,7 @@ { } - unique_ptr(T* p) : + explicit unique_ptr(T* p) : boost::movelib::unique_ptr<T>(p) { }
--- a/Core/DicomNetworking/DicomUserConnection.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Core/DicomNetworking/DicomUserConnection.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -86,6 +86,7 @@ # error The macro DCMTK_VERSION_NUMBER must be defined #endif +#include "../Compatibility.h" #include "../DicomFormat/DicomArray.h" #include "../Logging.h" #include "../OrthancException.h" @@ -1476,7 +1477,7 @@ { for (size_t i = 0; i < sopClassUids.size(); i++) { - std::auto_ptr<DcmItem> item(new DcmItem); + std::unique_ptr<DcmItem> item(new DcmItem); if (!item->putAndInsertString(DCM_ReferencedSOPClassUID, sopClassUids[i].c_str()).good() || !item->putAndInsertString(DCM_ReferencedSOPInstanceUID, sopInstanceUids[i].c_str()).good() || (hasFailureReasons &&
--- a/Core/DicomNetworking/Internals/CommandDispatcher.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Core/DicomNetworking/Internals/CommandDispatcher.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -478,6 +478,7 @@ storageTransferSyntaxes.push_back(UID_MPEG2MainProfileAtHighLevelTransferSyntax); } +#if DCMTK_VERSION_NUMBER >= 361 // New in Orthanc 1.6.0 if (!server.HasApplicationEntityFilter() || server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Mpeg4)) @@ -488,6 +489,7 @@ storageTransferSyntaxes.push_back(UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax); storageTransferSyntaxes.push_back(UID_MPEG4StereoHighProfileLevel4_2TransferSyntax); } +#endif if (!server.HasApplicationEntityFilter() || server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Rle)) @@ -1053,7 +1055,7 @@ * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.2.html#table_J.3-1 **/ - std::auto_ptr<DcmDataset> dataset( + std::unique_ptr<DcmDataset> dataset( ReadDataset(assoc_, "Cannot read the dataset in N-ACTION SCP", associationTimeout_)); std::string transactionUid = ReadString(*dataset, DCM_TransactionUID); @@ -1082,7 +1084,7 @@ try { - std::auto_ptr<IStorageCommitmentRequestHandler> handler + std::unique_ptr<IStorageCommitmentRequestHandler> handler (server_.GetStorageCommitmentRequestHandlerFactory(). ConstructStorageCommitmentRequestHandler()); @@ -1176,7 +1178,7 @@ * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.3.html#table_J.3-2 **/ - std::auto_ptr<DcmDataset> dataset( + std::unique_ptr<DcmDataset> dataset( ReadDataset(assoc_, "Cannot read the dataset in N-EVENT-REPORT SCP", associationTimeout_)); std::string transactionUid = ReadString(*dataset, DCM_TransactionUID); @@ -1221,7 +1223,7 @@ try { - std::auto_ptr<IStorageCommitmentRequestHandler> handler + std::unique_ptr<IStorageCommitmentRequestHandler> handler (server_.GetStorageCommitmentRequestHandlerFactory(). ConstructStorageCommitmentRequestHandler());
--- a/Core/DicomParsing/FromDcmtkBridge.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Core/DicomParsing/FromDcmtkBridge.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -68,10 +68,11 @@ #include <dcmtk/dcmdata/dcdicent.h> #include <dcmtk/dcmdata/dcdict.h> #include <dcmtk/dcmdata/dcfilefo.h> +#include <dcmtk/dcmdata/dcistrmb.h> #include <dcmtk/dcmdata/dcostrmb.h> #include <dcmtk/dcmdata/dcpixel.h> #include <dcmtk/dcmdata/dcuid.h> -#include <dcmtk/dcmdata/dcistrmb.h> +#include <dcmtk/dcmdata/dcxfer.h> #include <dcmtk/dcmdata/dcvrae.h> #include <dcmtk/dcmdata/dcvras.h>
--- a/Core/DicomParsing/FromDcmtkBridge_TransferSyntaxes.impl.h Tue Mar 17 13:11:44 2020 +0100 +++ b/Core/DicomParsing/FromDcmtkBridge_TransferSyntaxes.impl.h Tue Mar 17 16:39:38 2020 +0100 @@ -56,75 +56,147 @@ return true; case DicomTransferSyntax_JPEGProcess1: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess1TransferSyntax; +# else target = EXS_JPEGProcess1; +# endif return true; case DicomTransferSyntax_JPEGProcess2_4: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess2_4TransferSyntax; +# else target = EXS_JPEGProcess2_4; +# endif return true; case DicomTransferSyntax_JPEGProcess3_5: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess3_5TransferSyntax; +# else target = EXS_JPEGProcess3_5; +# endif return true; case DicomTransferSyntax_JPEGProcess6_8: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess6_8TransferSyntax; +# else target = EXS_JPEGProcess6_8; +# endif return true; case DicomTransferSyntax_JPEGProcess7_9: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess7_9TransferSyntax; +# else target = EXS_JPEGProcess7_9; +# endif return true; case DicomTransferSyntax_JPEGProcess10_12: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess10_12TransferSyntax; +# else target = EXS_JPEGProcess10_12; +# endif return true; case DicomTransferSyntax_JPEGProcess11_13: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess11_13TransferSyntax; +# else target = EXS_JPEGProcess11_13; +# endif return true; case DicomTransferSyntax_JPEGProcess14: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess14TransferSyntax; +# else target = EXS_JPEGProcess14; +# endif return true; case DicomTransferSyntax_JPEGProcess15: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess15TransferSyntax; +# else target = EXS_JPEGProcess15; +# endif return true; case DicomTransferSyntax_JPEGProcess16_18: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess16_18TransferSyntax; +# else target = EXS_JPEGProcess16_18; +# endif return true; case DicomTransferSyntax_JPEGProcess17_19: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess17_19TransferSyntax; +# else target = EXS_JPEGProcess17_19; +# endif return true; case DicomTransferSyntax_JPEGProcess20_22: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess20_22TransferSyntax; +# else target = EXS_JPEGProcess20_22; +# endif return true; case DicomTransferSyntax_JPEGProcess21_23: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess21_23TransferSyntax; +# else target = EXS_JPEGProcess21_23; +# endif return true; case DicomTransferSyntax_JPEGProcess24_26: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess24_26TransferSyntax; +# else target = EXS_JPEGProcess24_26; +# endif return true; case DicomTransferSyntax_JPEGProcess25_27: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess25_27TransferSyntax; +# else target = EXS_JPEGProcess25_27; +# endif return true; case DicomTransferSyntax_JPEGProcess28: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess28TransferSyntax; +# else target = EXS_JPEGProcess28; +# endif return true; case DicomTransferSyntax_JPEGProcess29: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess29TransferSyntax; +# else target = EXS_JPEGProcess29; +# endif return true; case DicomTransferSyntax_JPEGProcess14SV1: +# if DCMTK_VERSION_NUMBER <= 360 + target = EXS_JPEGProcess14SV1TransferSyntax; +# else target = EXS_JPEGProcess14SV1; +# endif return true; case DicomTransferSyntax_JPEGLSLossless: @@ -167,25 +239,35 @@ target = EXS_MPEG2MainProfileAtHighLevel; return true; +#if DCMTK_VERSION_NUMBER >= 361 case DicomTransferSyntax_MPEG4HighProfileLevel4_1: target = EXS_MPEG4HighProfileLevel4_1; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1: target = EXS_MPEG4BDcompatibleHighProfileLevel4_1; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo: target = EXS_MPEG4HighProfileLevel4_2_For2DVideo; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo: target = EXS_MPEG4HighProfileLevel4_2_For3DVideo; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2: target = EXS_MPEG4StereoHighProfileLevel4_2; return true; +#endif #if DCMTK_VERSION_NUMBER >= 362 case DicomTransferSyntax_HEVCMainProfileLevel5_1: @@ -230,75 +312,147 @@ target = DicomTransferSyntax_BigEndianExplicit; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess1TransferSyntax: +# else case EXS_JPEGProcess1: +# endif target = DicomTransferSyntax_JPEGProcess1; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess2_4TransferSyntax: +# else case EXS_JPEGProcess2_4: +# endif target = DicomTransferSyntax_JPEGProcess2_4; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess3_5TransferSyntax: +# else case EXS_JPEGProcess3_5: +# endif target = DicomTransferSyntax_JPEGProcess3_5; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess6_8TransferSyntax: +# else case EXS_JPEGProcess6_8: +# endif target = DicomTransferSyntax_JPEGProcess6_8; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess7_9TransferSyntax: +# else case EXS_JPEGProcess7_9: +# endif target = DicomTransferSyntax_JPEGProcess7_9; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess10_12TransferSyntax: +# else case EXS_JPEGProcess10_12: +# endif target = DicomTransferSyntax_JPEGProcess10_12; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess11_13TransferSyntax: +# else case EXS_JPEGProcess11_13: +# endif target = DicomTransferSyntax_JPEGProcess11_13; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess14TransferSyntax: +# else case EXS_JPEGProcess14: +# endif target = DicomTransferSyntax_JPEGProcess14; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess15TransferSyntax: +# else case EXS_JPEGProcess15: +# endif target = DicomTransferSyntax_JPEGProcess15; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess16_18TransferSyntax: +# else case EXS_JPEGProcess16_18: +# endif target = DicomTransferSyntax_JPEGProcess16_18; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess17_19TransferSyntax: +# else case EXS_JPEGProcess17_19: +# endif target = DicomTransferSyntax_JPEGProcess17_19; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess20_22TransferSyntax: +# else case EXS_JPEGProcess20_22: +# endif target = DicomTransferSyntax_JPEGProcess20_22; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess21_23TransferSyntax: +# else case EXS_JPEGProcess21_23: +# endif target = DicomTransferSyntax_JPEGProcess21_23; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess24_26TransferSyntax: +# else case EXS_JPEGProcess24_26: +# endif target = DicomTransferSyntax_JPEGProcess24_26; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess25_27TransferSyntax: +# else case EXS_JPEGProcess25_27: +# endif target = DicomTransferSyntax_JPEGProcess25_27; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess28TransferSyntax: +# else case EXS_JPEGProcess28: +# endif target = DicomTransferSyntax_JPEGProcess28; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess29TransferSyntax: +# else case EXS_JPEGProcess29: +# endif target = DicomTransferSyntax_JPEGProcess29; return true; +# if DCMTK_VERSION_NUMBER <= 360 + case EXS_JPEGProcess14SV1TransferSyntax: +# else case EXS_JPEGProcess14SV1: +# endif target = DicomTransferSyntax_JPEGProcess14SV1; return true; @@ -342,25 +496,35 @@ target = DicomTransferSyntax_MPEG2MainProfileAtHighLevel; return true; +#if DCMTK_VERSION_NUMBER >= 361 case EXS_MPEG4HighProfileLevel4_1: target = DicomTransferSyntax_MPEG4HighProfileLevel4_1; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case EXS_MPEG4BDcompatibleHighProfileLevel4_1: target = DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case EXS_MPEG4HighProfileLevel4_2_For2DVideo: target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case EXS_MPEG4HighProfileLevel4_2_For3DVideo: target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo; return true; +#endif +#if DCMTK_VERSION_NUMBER >= 361 case EXS_MPEG4StereoHighProfileLevel4_2: target = DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2; return true; +#endif #if DCMTK_VERSION_NUMBER >= 362 case EXS_HEVCMainProfileLevel5_1:
--- a/OrthancServer/ServerContext.h Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerContext.h Tue Mar 17 16:39:38 2020 +0100 @@ -168,11 +168,11 @@ void SaveJobsEngine(); - virtual void SignalJobSubmitted(const std::string& jobId); + virtual void SignalJobSubmitted(const std::string& jobId) ORTHANC_OVERRIDE; - virtual void SignalJobSuccess(const std::string& jobId); + virtual void SignalJobSuccess(const std::string& jobId) ORTHANC_OVERRIDE; - virtual void SignalJobFailure(const std::string& jobId); + virtual void SignalJobFailure(const std::string& jobId) ORTHANC_OVERRIDE; ServerIndex index_; IStorageArea& area_;
--- a/OrthancServer/ServerJobs/ArchiveJob.h Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerJobs/ArchiveJob.h Tue Mar 17 16:39:38 2020 +0100 @@ -89,29 +89,29 @@ void AddResource(const std::string& publicId); - virtual void Reset(); + virtual void Reset() ORTHANC_OVERRIDE; - virtual void Start(); + virtual void Start() ORTHANC_OVERRIDE; virtual JobStepResult Step(const std::string& jobId) ORTHANC_OVERRIDE; - virtual void Stop(JobStopReason reason) + virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE { } - virtual float GetProgress(); + virtual float GetProgress() ORTHANC_OVERRIDE; - virtual void GetJobType(std::string& target); + virtual void GetJobType(std::string& target) ORTHANC_OVERRIDE; - virtual void GetPublicContent(Json::Value& value); + virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; - virtual bool Serialize(Json::Value& value) + virtual bool Serialize(Json::Value& value) ORTHANC_OVERRIDE { return false; // Cannot serialize this kind of job } virtual bool GetOutput(std::string& output, MimeType& mime, - const std::string& key); + const std::string& key) ORTHANC_OVERRIDE; }; }
--- a/OrthancServer/ServerJobs/DicomModalityStoreJob.h Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.h Tue Mar 17 16:39:38 2020 +0100 @@ -62,9 +62,9 @@ void ResetStorageCommitment(); protected: - virtual bool HandleInstance(const std::string& instance); + virtual bool HandleInstance(const std::string& instance) ORTHANC_OVERRIDE; - virtual bool HandleTrailingStep(); + virtual bool HandleTrailingStep() ORTHANC_OVERRIDE; public: DicomModalityStoreJob(ServerContext& context); @@ -100,14 +100,14 @@ virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE; - virtual void GetJobType(std::string& target) + virtual void GetJobType(std::string& target) ORTHANC_OVERRIDE { target = "DicomModalityStore"; } - virtual void GetPublicContent(Json::Value& value); + virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; - virtual bool Serialize(Json::Value& target); + virtual bool Serialize(Json::Value& target) ORTHANC_OVERRIDE; virtual void Reset() ORTHANC_OVERRIDE;
--- a/OrthancServer/ServerJobs/DicomMoveScuJob.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerJobs/DicomMoveScuJob.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -63,7 +63,7 @@ return true; } - virtual void Serialize(Json::Value& target) const + virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE { findAnswer_->Serialize(target); }
--- a/OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -75,7 +75,7 @@ { } - virtual CommandType GetType() const + virtual CommandType GetType() const ORTHANC_OVERRIDE { return CommandType_Setup; } @@ -86,7 +86,7 @@ return true; } - virtual void Serialize(Json::Value& target) const + virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE { target = Json::objectValue; target[TYPE] = SETUP; @@ -111,7 +111,7 @@ { } - virtual CommandType GetType() const + virtual CommandType GetType() const ORTHANC_OVERRIDE { return CommandType_Lookup; } @@ -140,7 +140,7 @@ } } - virtual void Serialize(Json::Value& target) const + virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE { target = Json::objectValue; target[TYPE] = LOOKUP; @@ -168,7 +168,7 @@ } } - virtual CommandType GetType() const + virtual CommandType GetType() const ORTHANC_OVERRIDE { return CommandType_Answer; } @@ -179,7 +179,7 @@ return true; } - virtual void Serialize(Json::Value& target) const + virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE { target = Json::objectValue; target[TYPE] = ANSWER;
--- a/OrthancServer/ServerJobs/StorageCommitmentScpJob.h Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/ServerJobs/StorageCommitmentScpJob.h Tue Mar 17 16:39:38 2020 +0100 @@ -33,6 +33,7 @@ #pragma once +#include "../../Core/Compatibility.h" #include "../../Core/DicomNetworking/RemoteModalityParameters.h" #include "../../Core/JobsEngine/SetOfCommandsJob.h" #include "IStorageCommitmentFactory.h" @@ -68,7 +69,7 @@ std::vector<std::string> sopClassUids_; std::vector<std::string> sopInstanceUids_; - std::auto_ptr<IStorageCommitmentFactory::ILookupHandler> lookupHandler_; + std::unique_ptr<IStorageCommitmentFactory::ILookupHandler> lookupHandler_; void CheckInvariants();
--- a/OrthancServer/main.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/OrthancServer/main.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -36,6 +36,7 @@ #include <boost/algorithm/string/predicate.hpp> +#include "../Core/Compatibility.h" #include "../Core/DicomFormat/DicomArray.h" #include "../Core/DicomNetworking/DicomServer.h" #include "../Core/DicomParsing/FromDcmtkBridge.h" @@ -116,7 +117,7 @@ throw OrthancException(ErrorCode_InternalError); } - std::auto_ptr<StorageCommitmentScpJob> job( + std::unique_ptr<StorageCommitmentScpJob> job( new StorageCommitmentScpJob(context_, transactionUid, remoteAet, calledAet)); for (size_t i = 0; i < referencedSopClassUids.size(); i++)
--- a/Plugins/Engine/OrthancPlugins.h Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Engine/OrthancPlugins.h Tue Mar 17 16:39:38 2020 +0100 @@ -239,20 +239,20 @@ const Arguments& headers, const GetArguments& getArguments, const void* bodyData, - size_t bodySize); + size_t bodySize) ORTHANC_OVERRIDE; virtual bool InvokeService(SharedLibrary& plugin, _OrthancPluginService service, - const void* parameters); + const void* parameters) ORTHANC_OVERRIDE; - virtual void SignalChange(const ServerIndexChange& change); - + virtual void SignalChange(const ServerIndexChange& change) ORTHANC_OVERRIDE; + virtual void SignalStoredInstance(const std::string& instanceId, DicomInstanceToStore& instance, - const Json::Value& simplifiedTags); + const Json::Value& simplifiedTags) ORTHANC_OVERRIDE; virtual bool FilterIncomingInstance(const DicomInstanceToStore& instance, - const Json::Value& simplified) + const Json::Value& simplified) ORTHANC_OVERRIDE { return true; // TODO Enable filtering of instances from plugins } @@ -302,7 +302,7 @@ bool HasWorklistHandler(); - virtual IWorklistRequestHandler* ConstructWorklistRequestHandler(); + virtual IWorklistRequestHandler* ConstructWorklistRequestHandler() ORTHANC_OVERRIDE; bool HasCustomImageDecoder(); @@ -315,22 +315,22 @@ virtual ImageAccessor* Decode(const void* dicom, size_t size, - unsigned int frame); + unsigned int frame) ORTHANC_OVERRIDE; virtual bool IsAllowed(HttpMethod method, const char* uri, const char* ip, const char* username, const IHttpHandler::Arguments& httpHeaders, - const IHttpHandler::GetArguments& getArguments); + const IHttpHandler::GetArguments& getArguments) ORTHANC_OVERRIDE; bool HasFindHandler(); - virtual IFindRequestHandler* ConstructFindRequestHandler(); + virtual IFindRequestHandler* ConstructFindRequestHandler() ORTHANC_OVERRIDE; bool HasMoveHandler(); - virtual IMoveRequestHandler* ConstructMoveRequestHandler(); + virtual IMoveRequestHandler* ConstructMoveRequestHandler() ORTHANC_OVERRIDE; IJob* UnserializeJob(const std::string& type, const Json::Value& value); @@ -344,7 +344,7 @@ const char* username, HttpMethod method, const UriComponents& uri, - const Arguments& headers); + const Arguments& headers) ORTHANC_OVERRIDE; // New in Orthanc 1.6.0 IStorageCommitmentFactory::ILookupHandler* CreateStorageCommitment(
--- a/Plugins/Engine/PluginsJob.h Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Engine/PluginsJob.h Tue Mar 17 16:39:38 2020 +0100 @@ -51,30 +51,30 @@ virtual ~PluginsJob(); - virtual void Start() + virtual void Start() ORTHANC_OVERRIDE { } virtual JobStepResult Step(const std::string& jobId) ORTHANC_OVERRIDE; - virtual void Reset(); + virtual void Reset() ORTHANC_OVERRIDE; - virtual void Stop(JobStopReason reason); + virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE; - virtual float GetProgress(); + virtual float GetProgress() ORTHANC_OVERRIDE; - virtual void GetJobType(std::string& target) + virtual void GetJobType(std::string& target) ORTHANC_OVERRIDE { target = type_; } - virtual void GetPublicContent(Json::Value& value); + virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; - virtual bool Serialize(Json::Value& value); + virtual bool Serialize(Json::Value& value) ORTHANC_OVERRIDE; virtual bool GetOutput(std::string& output, MimeType& mime, - const std::string& key) + const std::string& key) ORTHANC_OVERRIDE { // TODO return false;
--- a/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -21,6 +21,7 @@ #include "GdcmDecoderCache.h" +#include "../../../Core/Compatibility.h" #include "OrthancImageWrapper.h" namespace OrthancPlugins @@ -83,13 +84,13 @@ } // This is not the same image - std::auto_ptr<GdcmImageDecoder> decoder(new GdcmImageDecoder(dicom, size)); - std::auto_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); + std::unique_ptr<GdcmImageDecoder> decoder(new GdcmImageDecoder(dicom, size)); + std::unique_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); { // Cache the newly created decoder for further use boost::mutex::scoped_lock lock(mutex_); - decoder_ = decoder; + decoder_.reset(decoder.release()); size_ = size; md5_ = md5; }
--- a/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h Tue Mar 17 16:39:38 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include "../../../Core/Compatibility.h" #include "GdcmImageDecoder.h" #include "OrthancImageWrapper.h" @@ -33,7 +34,7 @@ { private: boost::mutex mutex_; - std::auto_ptr<OrthancPlugins::GdcmImageDecoder> decoder_; + std::unique_ptr<OrthancPlugins::GdcmImageDecoder> decoder_; size_t size_; std::string md5_;
--- a/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -21,6 +21,7 @@ #include "GdcmImageDecoder.h" +#include "../../../Core/Compatibility.h" #include "OrthancImageWrapper.h" #include <gdcmImageReader.h> @@ -40,9 +41,9 @@ size_t size_; gdcm::ImageReader reader_; - std::auto_ptr<gdcm::ImageApplyLookupTable> lut_; - std::auto_ptr<gdcm::ImageChangePhotometricInterpretation> photometric_; - std::auto_ptr<gdcm::ImageChangePlanarConfiguration> interleaved_; + std::unique_ptr<gdcm::ImageApplyLookupTable> lut_; + std::unique_ptr<gdcm::ImageChangePhotometricInterpretation> photometric_; + std::unique_ptr<gdcm::ImageChangePlanarConfiguration> interleaved_; std::string decoded_; PImpl(const void* dicom,
--- a/Plugins/Samples/GdcmDecoder/Plugin.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/Plugin.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -19,6 +19,7 @@ **/ +#include "../../../Core/Compatibility.h" #include "GdcmDecoderCache.h" #include "OrthancImageWrapper.h" @@ -35,7 +36,7 @@ { try { - std::auto_ptr<OrthancPlugins::OrthancImageWrapper> image; + std::unique_ptr<OrthancPlugins::OrthancImageWrapper> image; #if 0 // Do not use the cache
--- a/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -19,6 +19,7 @@ **/ +#include "../../../Core/Compatibility.h" #include "../Common/OrthancPluginCppWrapper.h" #include <boost/filesystem.hpp> @@ -142,7 +143,7 @@ try { // Construct an object to match the worklists in the database against the C-Find query - std::auto_ptr<OrthancPlugins::FindMatcher> matcher(CreateMatcher(query, issuerAet)); + std::unique_ptr<OrthancPlugins::FindMatcher> matcher(CreateMatcher(query, issuerAet)); // Loop over the regular files in the database folder namespace fs = boost::filesystem;
--- a/Resources/DicomTransferSyntaxes.json Tue Mar 17 13:11:44 2020 +0100 +++ b/Resources/DicomTransferSyntaxes.json Tue Mar 17 16:39:38 2020 +0100 @@ -40,6 +40,7 @@ "Retired" : false, "Note" : "Default Transfer Syntax for Lossy JPEG 8-bit Image Compression", "DCMTK" : "EXS_JPEGProcess1", + "DCMTK360" : "EXS_JPEGProcess1TransferSyntax", "GDCM" : "gdcm::TransferSyntax::JPEGBaselineProcess1" }, @@ -50,6 +51,7 @@ "Retired" : false, "Note" : "Default Transfer Syntax for Lossy JPEG (lossy, 8/12 bit), 12-bit Image Compression (Process 4 only)", "DCMTK" : "EXS_JPEGProcess2_4", + "DCMTK360" : "EXS_JPEGProcess2_4TransferSyntax", "GDCM" : "gdcm::TransferSyntax::JPEGExtendedProcess2_4" }, @@ -58,7 +60,8 @@ "Name" : "JPEG Extended Sequential (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess3_5", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess3_5" + "DCMTK" : "EXS_JPEGProcess3_5", + "DCMTK360" : "EXS_JPEGProcess3_5TransferSyntax" }, { @@ -66,7 +69,8 @@ "Name" : "JPEG Spectral Selection, Nonhierarchical (lossy, 8/12 bit)", "Value" : "JPEGProcess6_8", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess6_8" + "DCMTK" : "EXS_JPEGProcess6_8", + "DCMTK360" : "EXS_JPEGProcess6_8TransferSyntax" }, { @@ -74,7 +78,8 @@ "Name" : "JPEG Spectral Selection, Nonhierarchical (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess7_9", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess7_9" + "DCMTK" : "EXS_JPEGProcess7_9", + "DCMTK360" : "EXS_JPEGProcess7_9TransferSyntax" }, { @@ -82,7 +87,8 @@ "Name" : "JPEG Full Progression, Nonhierarchical (lossy, 8/12 bit)", "Value" : "JPEGProcess10_12", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess10_12" + "DCMTK" : "EXS_JPEGProcess10_12", + "DCMTK360" : "EXS_JPEGProcess10_12TransferSyntax" }, { @@ -90,7 +96,8 @@ "Name" : "JPEG Full Progression, Nonhierarchical (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess11_13", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess11_13" + "DCMTK" : "EXS_JPEGProcess11_13", + "DCMTK360" : "EXS_JPEGProcess11_13TransferSyntax" }, { @@ -99,6 +106,7 @@ "Value" : "JPEGProcess14", "Retired" : false, "DCMTK" : "EXS_JPEGProcess14", + "DCMTK360" : "EXS_JPEGProcess14TransferSyntax", "GDCM" : "gdcm::TransferSyntax::JPEGLosslessProcess14" }, @@ -107,7 +115,8 @@ "Name" : "JPEG Lossless with any selection value, arithmetic coding", "Value" : "JPEGProcess15", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess15" + "DCMTK" : "EXS_JPEGProcess15", + "DCMTK360" : "EXS_JPEGProcess15TransferSyntax" }, { @@ -115,7 +124,8 @@ "Name" : "JPEG Extended Sequential, Hierarchical (lossy, 8/12 bit)", "Value" : "JPEGProcess16_18", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess16_18" + "DCMTK" : "EXS_JPEGProcess16_18", + "DCMTK360" : "EXS_JPEGProcess16_18TransferSyntax" }, { @@ -123,7 +133,8 @@ "Name" : "JPEG Extended Sequential, Hierarchical (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess17_19", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess17_19" + "DCMTK" : "EXS_JPEGProcess17_19", + "DCMTK360" : "EXS_JPEGProcess17_19TransferSyntax" }, { @@ -131,7 +142,8 @@ "Name" : "JPEG Spectral Selection, Hierarchical (lossy, 8/12 bit)", "Value" : "JPEGProcess20_22", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess20_22" + "DCMTK" : "EXS_JPEGProcess20_22", + "DCMTK360" : "EXS_JPEGProcess20_22TransferSyntax" }, { @@ -139,7 +151,8 @@ "Name" : "JPEG Spectral Selection, Hierarchical (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess21_23", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess21_23" + "DCMTK" : "EXS_JPEGProcess21_23", + "DCMTK360" : "EXS_JPEGProcess21_23TransferSyntax" }, { @@ -147,7 +160,8 @@ "Name" : "JPEG Full Progression, Hierarchical (lossy, 8/12 bit)", "Value" : "JPEGProcess24_26", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess24_26" + "DCMTK" : "EXS_JPEGProcess24_26", + "DCMTK360" : "EXS_JPEGProcess24_26TransferSyntax" }, { @@ -155,7 +169,8 @@ "Name" : "JPEG Full Progression, Hierarchical (lossy, 8/12 bit), arithmetic coding", "Value" : "JPEGProcess25_27", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess25_27" + "DCMTK" : "EXS_JPEGProcess25_27", + "DCMTK360" : "EXS_JPEGProcess25_27TransferSyntax" }, { @@ -163,7 +178,8 @@ "Name" : "JPEG Lossless, Hierarchical", "Value" : "JPEGProcess28", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess28" + "DCMTK" : "EXS_JPEGProcess28", + "DCMTK360" : "EXS_JPEGProcess28TransferSyntax" }, { @@ -171,7 +187,8 @@ "Name" : "JPEG Lossless, Hierarchical, arithmetic coding", "Value" : "JPEGProcess29", "Retired" : true, - "DCMTK" : "EXS_JPEGProcess29" + "DCMTK" : "EXS_JPEGProcess29", + "DCMTK360" : "EXS_JPEGProcess29TransferSyntax" }, { @@ -181,6 +198,7 @@ "Retired" : false, "Note" : "Default Transfer Syntax for Lossless JPEG Image Compression", "DCMTK" : "EXS_JPEGProcess14SV1", + "DCMTK360" : "EXS_JPEGProcess14SV1TransferSyntax", "GDCM" : "gdcm::TransferSyntax::JPEGLosslessProcess14_1" }, @@ -275,7 +293,8 @@ "Name" : "MPEG4 High Profile / Level 4.1", "Value" : "MPEG4HighProfileLevel4_1", "Retired" : false, - "DCMTK" : "EXS_MPEG4HighProfileLevel4_1" + "DCMTK" : "EXS_MPEG4HighProfileLevel4_1", + "SinceDCMTK" : "361" }, { @@ -283,7 +302,8 @@ "Name" : "MPEG4 BD-compatible High Profile / Level 4.1", "Value" : "MPEG4BDcompatibleHighProfileLevel4_1", "Retired" : false, - "DCMTK" : "EXS_MPEG4BDcompatibleHighProfileLevel4_1" + "DCMTK" : "EXS_MPEG4BDcompatibleHighProfileLevel4_1", + "SinceDCMTK" : "361" }, { @@ -291,7 +311,8 @@ "Name" : "MPEG4 High Profile / Level 4.2 For 2D Video", "Value" : "MPEG4HighProfileLevel4_2_For2DVideo", "Retired" : false, - "DCMTK" : "EXS_MPEG4HighProfileLevel4_2_For2DVideo" + "DCMTK" : "EXS_MPEG4HighProfileLevel4_2_For2DVideo", + "SinceDCMTK" : "361" }, { @@ -299,7 +320,8 @@ "Name" : "MPEG4 High Profile / Level 4.2 For 3D Video", "Value" : "MPEG4HighProfileLevel4_2_For3DVideo", "Retired" : false, - "DCMTK" : "EXS_MPEG4HighProfileLevel4_2_For3DVideo" + "DCMTK" : "EXS_MPEG4HighProfileLevel4_2_For3DVideo", + "SinceDCMTK" : "361" }, { @@ -307,7 +329,8 @@ "Name" : "1.2.840.10008.1.2.4.106", "Value" : "MPEG4StereoHighProfileLevel4_2", "Retired" : false, - "DCMTK" : "EXS_MPEG4StereoHighProfileLevel4_2" + "DCMTK" : "EXS_MPEG4StereoHighProfileLevel4_2", + "SinceDCMTK" : "361" }, {
--- a/Resources/GenerateTransferSyntaxesDcmtk.mustache Tue Mar 17 13:11:44 2020 +0100 +++ b/Resources/GenerateTransferSyntaxesDcmtk.mustache Tue Mar 17 16:39:38 2020 +0100 @@ -45,7 +45,16 @@ #if DCMTK_VERSION_NUMBER >= {{SinceDCMTK}} {{/SinceDCMTK}} case DicomTransferSyntax_{{Value}}: + {{#DCMTK360}} +# if DCMTK_VERSION_NUMBER <= 360 + target = {{DCMTK360}}; +# else target = {{DCMTK}}; +# endif + {{/DCMTK360}} + {{^DCMTK360}} + target = {{DCMTK}}; + {{/DCMTK360}} return true; {{#SinceDCMTK}} #endif @@ -69,7 +78,16 @@ {{#SinceDCMTK}} #if DCMTK_VERSION_NUMBER >= {{SinceDCMTK}} {{/SinceDCMTK}} + {{#DCMTK360}} +# if DCMTK_VERSION_NUMBER <= 360 + case {{DCMTK360}}: +# else case {{DCMTK}}: +# endif + {{/DCMTK360}} + {{^DCMTK360}} + case {{DCMTK}}: + {{/DCMTK360}} target = DicomTransferSyntax_{{Value}}; return true; {{#SinceDCMTK}}
--- a/UnitTestsSources/FromDcmtkTests.cpp Tue Mar 17 13:11:44 2020 +0100 +++ b/UnitTestsSources/FromDcmtkTests.cpp Tue Mar 17 16:39:38 2020 +0100 @@ -2307,7 +2307,7 @@ //SystemToolbox::ReadFile(s, "/home/jodogne/Subversion/orthanc-tests/Database/Brainix/Epi/IM-0001-0002.dcm"); SystemToolbox::ReadFile(s, "/home/jodogne/Subversion/orthanc-tests/Database/TransferSyntaxes/1.2.840.10008.1.2.1.dcm"); - std::auto_ptr<DcmFileFormat> dicom(FromDcmtkBridge::LoadFromMemoryBuffer(s.c_str(), s.size())); + std::unique_ptr<DcmFileFormat> dicom(FromDcmtkBridge::LoadFromMemoryBuffer(s.c_str(), s.size())); // less /home/jodogne/Downloads/dcmtk-3.6.4/dcmdata/include/dcmtk/dcmdata/dcxfer.h printf(">> %d\n", dicom->getDataset()->getOriginalXfer()); // => 4 == EXS_JPEGProcess1