# HG changeset patch # User Sebastien Jodogne # Date 1611648905 -3600 # Node ID b6818bbef7b8948c7f6af409c5780707586a0bba # Parent 06d164d8a0fd5db77f8d99474f5ba7c1dd0392a8 patch of DCMTK 3.6.6 to fix value of "MediaStorageSOPClassUID" if writing DICOMDIR diff -r 06d164d8a0fd -r b6818bbef7b8 OrthancFramework/Resources/Patches/dcmtk-3.6.6.patch --- a/OrthancFramework/Resources/Patches/dcmtk-3.6.6.patch Mon Jan 25 18:38:29 2021 +0100 +++ b/OrthancFramework/Resources/Patches/dcmtk-3.6.6.patch Tue Jan 26 09:15:05 2021 +0100 @@ -1,6 +1,6 @@ diff -urEb dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake ---- dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake 2021-01-25 18:22:10.509991762 +0100 -+++ dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake 2021-01-25 18:22:48.137961762 +0100 +--- dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake 2021-01-26 08:51:48.815071681 +0100 ++++ dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake 2021-01-26 08:52:06.331135995 +0100 @@ -169,6 +169,8 @@ endif() @@ -19,8 +19,8 @@ # Check for include files, libraries, and functions include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake") diff -urEb dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h ---- dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-25 18:22:10.557991724 +0100 -+++ dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-25 18:23:31.837926724 +0100 +--- dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-26 08:51:48.859071844 +0100 ++++ dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-26 08:52:06.331135995 +0100 @@ -152,6 +152,12 @@ /// returns an iterator to the end of the repeating tag dictionary DcmDictEntryListIterator repeatingEnd() { return repDict.end(); } @@ -34,9 +34,28 @@ private: /** private undefined assignment operator +diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcdicdir.cc dcmtk-3.6.6/dcmdata/libsrc/dcdicdir.cc +--- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdicdir.cc 2021-01-26 08:51:48.863071859 +0100 ++++ dcmtk-3.6.6/dcmdata/libsrc/dcdicdir.cc 2021-01-26 08:56:03.519887982 +0100 +@@ -1032,7 +1032,14 @@ + // insert Media Stored SOP Class UID + insertMediaSOPUID(metainfo); + +- getDirFileFormat().validateMetaInfo(outxfer); ++ /** ++ * Patch for Orthanc: In DCMTK 3.6.6, the default value for the ++ * second argument changed from "EWM_fileformat" to ++ * "EWM_createNewMeta". This sets "MediaStorageSOPClassUID" ++ * (0002,0002) in meta-header to "1.2.276.0.7230010.3.1.0.1" ++ * instead of expected "1.2.840.10008.1.3.10". ++ **/ ++ getDirFileFormat().validateMetaInfo(outxfer, EWM_fileformat); + + { + // it is important that the cache object is destroyed before the file is renamed! diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc ---- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc 2021-01-25 18:22:10.557991724 +0100 -+++ dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc 2021-01-25 18:23:48.973912945 +0100 +--- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc 2021-01-26 08:51:48.863071859 +0100 ++++ dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc 2021-01-26 08:52:06.331135995 +0100 @@ -900,3 +900,6 @@ wrlock().clear(); wrunlock(); @@ -45,8 +64,8 @@ + +#include "dcdict_orthanc.cc" diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc ---- dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc 2021-01-25 18:22:10.561991720 +0100 -+++ dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc 2021-01-25 18:24:15.113891861 +0100 +--- dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc 2021-01-26 08:51:48.863071859 +0100 ++++ dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc 2021-01-26 08:52:06.335136010 +0100 @@ -36,6 +36,9 @@ #include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ #include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ @@ -58,8 +77,8 @@ // ******************************** diff -urEb dcmtk-3.6.6.orig/oflog/include/dcmtk/oflog/thread/syncpub.h dcmtk-3.6.6/oflog/include/dcmtk/oflog/thread/syncpub.h ---- dcmtk-3.6.6.orig/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-25 18:22:10.545991733 +0100 -+++ dcmtk-3.6.6/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-25 18:25:09.809847547 +0100 +--- dcmtk-3.6.6.orig/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-26 08:51:48.847071800 +0100 ++++ dcmtk-3.6.6/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-26 08:52:06.335136010 +0100 @@ -63,7 +63,7 @@ DCMTK_LOG4CPLUS_INLINE_EXPORT @@ -106,8 +125,8 @@ diff -urEb dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc dcmtk-3.6.6/oflog/libsrc/oflog.cc ---- dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc 2021-01-25 18:22:10.545991733 +0100 -+++ dcmtk-3.6.6/oflog/libsrc/oflog.cc 2021-01-25 18:25:27.389833244 +0100 +--- dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc 2021-01-26 08:51:48.847071800 +0100 ++++ dcmtk-3.6.6/oflog/libsrc/oflog.cc 2021-01-26 08:52:06.335136010 +0100 @@ -19,6 +19,10 @@ * */ @@ -120,8 +139,8 @@ #include "dcmtk/oflog/oflog.h" diff -urEb dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h ---- dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h 2021-01-25 18:22:10.561991720 +0100 -+++ dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h 2021-01-25 18:25:57.437808753 +0100 +--- dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h 2021-01-26 08:51:48.863071859 +0100 ++++ dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h 2021-01-26 08:52:06.335136010 +0100 @@ -586,7 +586,7 @@ */ void setlinebuf() diff -r 06d164d8a0fd -r b6818bbef7b8 OrthancFramework/Sources/DicomParsing/DicomDirWriter.cpp --- a/OrthancFramework/Sources/DicomParsing/DicomDirWriter.cpp Mon Jan 25 18:38:29 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/DicomDirWriter.cpp Tue Jan 26 09:15:05 2021 +0100 @@ -489,7 +489,7 @@ return true; // Newly created } - void Read(std::string& s) + void Write(std::string& s) { if (!GetDicomDir().write(DICOMDIR_DEFAULT_TRANSFERSYNTAX, EET_UndefinedLength /*encodingType*/, @@ -574,7 +574,7 @@ void DicomDirWriter::Encode(std::string& target) { - pimpl_->Read(target); + pimpl_->Write(target); }