comparison OrthancFramework/Resources/Patches/dcmtk-3.6.6.patch @ 4471:b6818bbef7b8

patch of DCMTK 3.6.6 to fix value of "MediaStorageSOPClassUID" if writing DICOMDIR
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Jan 2021 09:15:05 +0100
parents 06d164d8a0fd
children 1b6b88f017b9
comparison
equal deleted inserted replaced
4470:06d164d8a0fd 4471:b6818bbef7b8
1 diff -urEb dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake 1 diff -urEb dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake
2 --- dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake 2021-01-25 18:22:10.509991762 +0100 2 --- dcmtk-3.6.6.orig/CMake/GenerateDCMTKConfigure.cmake 2021-01-26 08:51:48.815071681 +0100
3 +++ dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake 2021-01-25 18:22:48.137961762 +0100 3 +++ dcmtk-3.6.6/CMake/GenerateDCMTKConfigure.cmake 2021-01-26 08:52:06.331135995 +0100
4 @@ -169,6 +169,8 @@ 4 @@ -169,6 +169,8 @@
5 endif() 5 endif()
6 6
7 # Check the sizes of various types 7 # Check the sizes of various types
8 +if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") 8 +if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
17 +endif() 17 +endif()
18 18
19 # Check for include files, libraries, and functions 19 # Check for include files, libraries, and functions
20 include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake") 20 include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake")
21 diff -urEb dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h 21 diff -urEb dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h
22 --- dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-25 18:22:10.557991724 +0100 22 --- dcmtk-3.6.6.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-26 08:51:48.859071844 +0100
23 +++ dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-25 18:23:31.837926724 +0100 23 +++ dcmtk-3.6.6/dcmdata/include/dcmtk/dcmdata/dcdict.h 2021-01-26 08:52:06.331135995 +0100
24 @@ -152,6 +152,12 @@ 24 @@ -152,6 +152,12 @@
25 /// returns an iterator to the end of the repeating tag dictionary 25 /// returns an iterator to the end of the repeating tag dictionary
26 DcmDictEntryListIterator repeatingEnd() { return repDict.end(); } 26 DcmDictEntryListIterator repeatingEnd() { return repDict.end(); }
27 27
28 + // Function by the Orthanc project to load a dictionary from a 28 + // Function by the Orthanc project to load a dictionary from a
32 + OFBool loadFromMemory(const std::string& content, OFBool errorIfAbsent = OFTrue); 32 + OFBool loadFromMemory(const std::string& content, OFBool errorIfAbsent = OFTrue);
33 + 33 +
34 private: 34 private:
35 35
36 /** private undefined assignment operator 36 /** private undefined assignment operator
37 diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcdicdir.cc dcmtk-3.6.6/dcmdata/libsrc/dcdicdir.cc
38 --- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdicdir.cc 2021-01-26 08:51:48.863071859 +0100
39 +++ dcmtk-3.6.6/dcmdata/libsrc/dcdicdir.cc 2021-01-26 08:56:03.519887982 +0100
40 @@ -1032,7 +1032,14 @@
41 // insert Media Stored SOP Class UID
42 insertMediaSOPUID(metainfo);
43
44 - getDirFileFormat().validateMetaInfo(outxfer);
45 + /**
46 + * Patch for Orthanc: In DCMTK 3.6.6, the default value for the
47 + * second argument changed from "EWM_fileformat" to
48 + * "EWM_createNewMeta". This sets "MediaStorageSOPClassUID"
49 + * (0002,0002) in meta-header to "1.2.276.0.7230010.3.1.0.1"
50 + * instead of expected "1.2.840.10008.1.3.10".
51 + **/
52 + getDirFileFormat().validateMetaInfo(outxfer, EWM_fileformat);
53
54 {
55 // it is important that the cache object is destroyed before the file is renamed!
37 diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc 56 diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc
38 --- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc 2021-01-25 18:22:10.557991724 +0100 57 --- dcmtk-3.6.6.orig/dcmdata/libsrc/dcdict.cc 2021-01-26 08:51:48.863071859 +0100
39 +++ dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc 2021-01-25 18:23:48.973912945 +0100 58 +++ dcmtk-3.6.6/dcmdata/libsrc/dcdict.cc 2021-01-26 08:52:06.331135995 +0100
40 @@ -900,3 +900,6 @@ 59 @@ -900,3 +900,6 @@
41 wrlock().clear(); 60 wrlock().clear();
42 wrunlock(); 61 wrunlock();
43 } 62 }
44 + 63 +
45 + 64 +
46 +#include "dcdict_orthanc.cc" 65 +#include "dcdict_orthanc.cc"
47 diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc 66 diff -urEb dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc
48 --- dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc 2021-01-25 18:22:10.561991720 +0100 67 --- dcmtk-3.6.6.orig/dcmdata/libsrc/dcpxitem.cc 2021-01-26 08:51:48.863071859 +0100
49 +++ dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc 2021-01-25 18:24:15.113891861 +0100 68 +++ dcmtk-3.6.6/dcmdata/libsrc/dcpxitem.cc 2021-01-26 08:52:06.335136010 +0100
50 @@ -36,6 +36,9 @@ 69 @@ -36,6 +36,9 @@
51 #include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */ 70 #include "dcmtk/dcmdata/dcostrma.h" /* for class DcmOutputStream */
52 #include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */ 71 #include "dcmtk/dcmdata/dcwcache.h" /* for class DcmWriteCache */
53 72
54 +#undef max 73 +#undef max
56 + 75 +
57 76
58 // ******************************** 77 // ********************************
59 78
60 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 79 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
61 --- dcmtk-3.6.6.orig/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-25 18:22:10.545991733 +0100 80 --- dcmtk-3.6.6.orig/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-26 08:51:48.847071800 +0100
62 +++ dcmtk-3.6.6/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-25 18:25:09.809847547 +0100 81 +++ dcmtk-3.6.6/oflog/include/dcmtk/oflog/thread/syncpub.h 2021-01-26 08:52:06.335136010 +0100
63 @@ -63,7 +63,7 @@ 82 @@ -63,7 +63,7 @@
64 83
65 DCMTK_LOG4CPLUS_INLINE_EXPORT 84 DCMTK_LOG4CPLUS_INLINE_EXPORT
66 Mutex::Mutex (Mutex::Type t) 85 Mutex::Mutex (Mutex::Type t)
67 - : mtx (DCMTK_LOG4CPLUS_THREADED (new impl::Mutex (t)) + 0) 86 - : mtx (DCMTK_LOG4CPLUS_THREADED (new impl::Mutex (t)) + 0)
104 + : sm (DCMTK_LOG4CPLUS_THREADED (new impl::SharedMutex)) 123 + : sm (DCMTK_LOG4CPLUS_THREADED (new impl::SharedMutex))
105 { } 124 { }
106 125
107 126
108 diff -urEb dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc dcmtk-3.6.6/oflog/libsrc/oflog.cc 127 diff -urEb dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc dcmtk-3.6.6/oflog/libsrc/oflog.cc
109 --- dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc 2021-01-25 18:22:10.545991733 +0100 128 --- dcmtk-3.6.6.orig/oflog/libsrc/oflog.cc 2021-01-26 08:51:48.847071800 +0100
110 +++ dcmtk-3.6.6/oflog/libsrc/oflog.cc 2021-01-25 18:25:27.389833244 +0100 129 +++ dcmtk-3.6.6/oflog/libsrc/oflog.cc 2021-01-26 08:52:06.335136010 +0100
111 @@ -19,6 +19,10 @@ 130 @@ -19,6 +19,10 @@
112 * 131 *
113 */ 132 */
114 133
115 +#if defined(_WIN32) 134 +#if defined(_WIN32)
118 + 137 +
119 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 138 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
120 #include "dcmtk/oflog/oflog.h" 139 #include "dcmtk/oflog/oflog.h"
121 140
122 diff -urEb dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h 141 diff -urEb dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h
123 --- dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h 2021-01-25 18:22:10.561991720 +0100 142 --- dcmtk-3.6.6.orig/ofstd/include/dcmtk/ofstd/offile.h 2021-01-26 08:51:48.863071859 +0100
124 +++ dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h 2021-01-25 18:25:57.437808753 +0100 143 +++ dcmtk-3.6.6/ofstd/include/dcmtk/ofstd/offile.h 2021-01-26 08:52:06.335136010 +0100
125 @@ -586,7 +586,7 @@ 144 @@ -586,7 +586,7 @@
126 */ 145 */
127 void setlinebuf() 146 void setlinebuf()
128 { 147 {
129 -#if defined(_WIN32) || defined(__hpux) 148 -#if defined(_WIN32) || defined(__hpux)