# Slicer DCMTK needs an update

**URL:** <https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363>\
**Category:** Development\
**Tags:** dicom\
**Created:** [February 16, 2024, 2:29pm UTC](https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363 "2024-02-16T14:29:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [February 16, 2024, 2:29pm UTC](https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363/1 "2024-02-16T14:29:21Z")

</div>

Slicer is using DCMTK version 3.6.6, which based on the tag in [GitHub - commontk/DCMTK at patched-DCMTK-3.6.6\_20210115](https://github.com/commontk/DCMTK/tree/patched-DCMTK-3.6.6_20210115) is from October 2021! Current version of DCMTK is 3.6.8: [git.dcmtk.org Git - dcmtk.git/summary](https://git.dcmtk.org/?p=dcmtk.git;a=summary).

Michael Onken has been trying to update DCMTK in dcmqi, see [WIP: Use DcmItem in API where possible. by michaelonken · Pull Request #493 · QIICR/dcmqi · GitHub](https://github.com/QIICR/dcmqi/pull/493), but is struggling with CMake linked libraries configuration.

@jcfr @lassoan can we join forces to figure this out, and upgrade DCMTK both for Slicer and dcmqi? Anyone else with the knowledge of CMake/Superbuld who can help?

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [February 16, 2024, 2:34pm UTC](https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363/2 "2024-02-16T14:34:36Z")

</div>

Here was some existing work-in-progress to update to version 3.6.7:

> <https://github.com/Slicer/Slicer/pull/6709>
>
> re #5944 
> 
> Updating DCMTK from 3.6.6 to 3.6.7 will include this bug fix for Ap…ple Silicon https://github.com/DCMTK/dcmtk/commit/5fba853b6f7c13b02bed28bd9f7d3f450e4c72bb
> 
> The upstream DCMTK repo is being used here because all previous backports are included in this latest version of DCMTK.
> 
> \`\`\`
> List of changes:
> 
> $ git shortlog 0f9bf4d..DCMTK-3.6.7 --no-merges
> Claus Stovgaard (2):
> Add DCMTK\_NO\_TRY\_RUN for cross compiling
> Incorporate DCMTK\_NO\_TRY\_RUN and DCMTK\_ENABLE\_STL
> 
> Jan Schlamelcher (13):
> Introduced a CMake option for static linking.
> Introduced CMake variable DCMTK\_TLS\_LIBRARY\_POSTFIX.
> Documented DCMTK\_TLS\_LIBRARY\_POSTFIX in INSTALL.
> Introduced OFdeprecated and OFdeprecated\_msg.
> Introduced path separator conversion for OFpath.
> Fixed typo in previous commit.
> Enabled various compiler warnings by default.
> Fixed a stupid mistake in the previous commit.
> Added a workaround for preventing MSVC warning D9025.
> Fixed some warnings in dcmiod.
> Changed minimum required CMake version to 3.0.0.
> Various enhancements for DCMTK's CMake exports.
> Removed some dead code (CMake).
> 
> Joerg Riesmeier (114):
> Also updated GNU Autoconf files.
> Added support for another Value Type (CP-2053).
> Fixed typo and added space characters.
> Added missing object files to Makefile.
> Fixed wrong indentation.
> Removed unused variable (reported by gcc).
> Added missing "unistd" header include.
> Removed unused variable (reported by gcc).
> Made API documentation more consistent.
> Removed unused variable (reported by gcc).
> Rebuilt Makefile dependencies.
> Updated data dictionary for DICOM 2021a.
> Updated code definitions for DICOM 2021a.
> Updated Context Group classes for DICOM 2021a.
> Increased number of digits printed for FL values.
> Added support for two new Storage SOP Classes.
> Fixed typo and corrected line breaks in manpage.
> No need to convert ASCII or UTF-8 characters.
> Fixed comment on lossy JPEG vs. lossy JPEG-LS.
> Removed empty line.
> Removed outdated configure options (Autoconf).
> Added support for CP-2023.
> Added support for Patient's Size and Weight.
> Updated latest tested CMake version.
> Removed empty line from "verbatim" environment.
> Always begin condition text with a capital letter.
> Fixed issue when compiling without MT support.
> Minor changes to documentation.
> Fixed issue with findAndGetUint16Array and VR=AT.
> Fixed wrong class name in file header.
> Added typical error handling options to xml2dcm.
> Updated data dictionary for DICOM 2021b.
> Updated code definitions for DICOM 2021b.
> Added support for CID 247.
> Fixed issue caused by changed attribute name.
> Ignore missing binary value in meta header.
> Added new test case for Contour Data.
> Check whether call of saveFile() was successful.
> Added support for new Storage SOP Class.
> Added "Enhanced X-Ray Radiation Dose SR" to list.
> Modified overlay rendering for multi-frame images.
> Removed check on CMAKE\_BACKWARDS\_COMPATIBILITY.
> Added support for CP-1789 and CP-1998.
> Output helpful warning messages to logger.
> Added support for CP-2084.
> Removed empty line (added by previous commit).
> Fixed order of libraries to be linked.
> Added missing newline at end of file.
> Updated data dictionary for DICOM 2021c.
> Updated code definitions for DICOM 2021c.
> Added support for new Storage SOP Class.
> Added support for directory record "ANNOTATION".
> Minor fixes to syntax usage and formatting.
> Enhanced API documentation of putAndInsertXXX().
> Updated data dictionary for DICOM 2021d.
> Updated code definitions for DICOM 2021d.
> Updated Context Group classes for DICOM 2021d.
> Replaced old-style cast by OFstatic\_cast().
> Fixed issue with unknown UID name.
> Check for space character in File-set ID.
> Replaced German umlaut by its transliteration.
> Removed trailing Unicode character from UID value.
> Converted non-ASCII characters to ASCII.
> Removed trailing Unicode character in manpage.
> Fixed further inconsistencies.
> Fixed typo in comment.
> Output more build options with --version.
> Removed useless typecasts from inline method.
> Added support for two new Storage SOP Classes.
> Enhanced Autoconf build system for OpenSSL checks.
> Fixed issue with findAndGetUint16Array() for OB.
> Fixed comment on Autoconf define HAVE\_CXX.
> Changed order of OpenSSL libraries (Autoconf).
> Replaced OFListIterator by OFListConstIterator.
> Added missing spaces (removed by previous commit).
> Updated data dictionary for DICOM 2021e.
> Fixed Media Storage SOP Class UID in DICOMDIR.
> Updated code definitions for DICOM 2021e.
> Fixed typo.
> Removed extra space.
> Updated data dictionary for DICOM 2022a.
> Updated code definitions for DICOM 2022a.
> Removed email addresses and trailing spaces.
> Fixed spelling of attribute name in log message.
> Introduced plural form where appropriate.
> Added missing well-known frame of reference.
> Made use of DCM\_PixelItemTag where appropriate.
> Updated Doxygen configuration files.
> Added check on empty Unique Keys in "strict mode".
> Extended comment on Type of Modality attribute.
> Do not set instance creator UID automatically.
> Made XML elements "date" and "time" optional.
> Do not create new document in readXML().
> Fixed typos and revised line breaks.
> Added check on missing Unique Key (strict mode).
> Specified "non-signficant characters" for VR UC.
> Removed misplaced comment character "//".
> Fixed "delimiter characters" for VR UC.
> Various minor fixes to "macros.txt".
> Fixed some outdated DIMSE Status strings.
> Replaced use of deprecated DIMSE Status Codes.
> Fixed documentation of default options.
> Minor fixes to documentation.
> Don't add Derivation Description to Icon Images.
> Fixed incorrect warning in JPEG-LS decoder.
> Made log output in this module more consistent.
> Fixed wrong VR in JSON example (see CP-2139).
> Fixed typo in comment.
> Replaced http:// by https:// in documentation.
> Updated copyright date.
> Updated data dictionary for DICOM 2022b.
> Updated code definitions for DICOM 2022b.
> Updated Context Group classes for DICOM 2022b.
> Fixed line breaks in CHANGES file.
> 
> Marco Eichelberg (154):
> Added support for stdin/stdout DICOM file I/O.
> Do not redirect stderr to stdout on Windows anymore.
> Fixed stdin/stdout DICOM file I/O on Win32.
> Improved performance of DcmStdinStream.
> Fixed minor warnings reported by gcc -Wextra.
> Fixed parentheses.
> Migrated dcmsign to OpenSSL high-level APIs.
> Adapted dcmpstat to commit d588139e2.
> Updated code handling Diffie-Hellman parameters.
> Restored compatibility with OpenSSL 1.0.1.
> Fixed minor warnings related to type conversions.
> New function ASC\_closeTransportConnection().
> Added hints for a better detection of OpenJPEG.
> Added missing comma to dcm2json --write-meta.
> Expanded dcm2json manpage.
> Adjusted the number of digits printed for FL and FD.
> Fixed incorrect handling of malformed JPEG bitstream.
> Fixed commit e8161b1e4.
> Fixed minor warnings reported by Visual Studio.
> Fixed include of \<inttypes.h\>.
> Added include needed on BSD.
> Added includes needed on Solaris.
> Added missing include.
> Added includes needed on NetBSD.
> Fixed includes for VS 2008.
> Fixed compilation of arith.cc with DCMTK\_ENABLE\_CXX11=ON.
> Added further missing includes
> Added support for intermediate CAs and CRLs.
> Added functions for offline certificate verification.
> Revised error handling in module dcmtls.
> Fixed minor inconsistencies.
> Added missing include.
> Fixed compilation without OpenSSL.
> Added include missing on Windows.
> Fixed warning reported by Visual Studio.
> Fix for compilation of dcmtls on Solaris.
> Modifications for LibreSSL on OpenBSD.
> Added includes needed by VS2008.
> Moved inline methods to implementation file.
> Added DCMTK\_OFSTD\_EXPORT to class OFFile.
> Minor changes needed on Solaris.
> Added include needed by VS2008.
> Defined cmake\_minimum\_required() as interval.
> Fixed LFS and vsnprintf on Windows and Solaris.
> Added includes needed on Solaris.
> Don't mask error code of association negotiation failure.
> Removed "using namespace std" statements.
> Fixed TOC-TOU race in storescp directory creation.
> Fixed warnings about possible null ptr dereference.
> Fixed configure warnings reported by CMake 3.19.
> Fixed issue in CMake scripts.
> Check if policy CMP0103 exists before setting it.
> Define \_\_STDC\_FORMAT\_MACROS in oftypes.h.
> Include \<cinttypes\> when compiling in C++11 mode.
> Replaced DCMTK\_DIAGNOSTIC\_MIN\_GCC\_VERSION macro.
> Fixed comments.
> Fixed warnings on Solaris with SunPro compiler.
> Added error messages for unsupported include macros.
> Special handling of preprocessor warnings for MSVC.
> Set CMake CMP0115 introduced with CMake 3.20 to OLD.
> Added default in switch statement.
> Attempt to make the ofthread unit test more robust.
> Fixed minor bug in ofthread unit test.
> Added debug output to ofstd\_thread semaphore test.
> Added additional check to dcmtls\_scp\_tls test.
> Added checks to dcmtls test cases.
> Fixed possible race condition of ofthread test.
> Fixed storescu return code issues.
> Changed default TLS profile to BCP 195 ND.
> Use random port number for dcmtls unit tests.
> Switch stdin to binary mode on Windows.
> Accept forward slash as path separator on Windows.
> Fixed previous commit.
> Accept forward slash as path separator on Windows.
> Set TLS session ID and disable session caching.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Fixed minor warnings.
> Removed dead code that caused warnings on MSVC.
> Fixed minor warnings.
> Fixed minor warnings.
> Documented MSVC versions not supported anymore.
> Fixed issue that caused duplicate calls to the DicomImage constructor to fail when a compressed image is loadad and the result of DcmDataset::getCurrentXfer() is passed as the second parameter.
> Support "-" as special output filename.
> Moved xml2dcm functionality into a class.
> Added support for XML comment tags.
> Added support for XML import and OP output.
> Added missing linefeed.
> Fixed Makefiles.
> Fixed Makefiles.
> Fixed test for maximum supported file size.
> Fixed previous commit.
> Fixed compilation with shared libraries.
> Added explicit include for \<cerrno\>.
> Fixed double inclusion of libxml2.
> Fixed minor warnings.
> Send SpecificCharacterSet in BFS N-CREATE-RQ.
> Convert monochrome BMP images to MONOCHROME2.
> Added error code EC\_SOPClassMismatch.
> Updated XML templates for img2dcm.
> Added multiframe support to img2dcm.
> Fixed minor warnings.
> Fixed bug in class Image2Dcm.
> Made file extensions explicit for CMake CMP0115.
> Enable compilation of DCMTK on DragonFly BSD.
> Fixed compilation on Solaris after previous commit.
> Send Illumination and RefAL only when non-empty.
> Fixed minor warning issued by gcc 10.2.1.
> Removed const qualifier in static function.
> Fixed Posix feature flags for Android build.
> Fixed warnings when compiling with OpenSSL 3.0.
> Removed definition of NEED\_DARRAY macro.
> Fixed bug in SiCertificate::getCertCurveName().
> Check whether DICOM dataset contains extended chars.
> Fixed incorrect constructor call.
> Introduced configure tests for OpenSSL features.
> Added two additional configure tests needed on OpenBSD.
> Removed duplicate test.
> Enable C-GET for write protected storage areas.
> Fixed memory leak in DcmElement::getPartialValue().
> Renamed OpenSSL related feature test symbols.
> Fixed previous commit.
> Documented cross-compiling support.
> Improvements to pkg-config support.
> Fixed CMake OpenSSL feature tests.
> Added logger output for OpenSSL initialization.
> Fixed undefined behavior in handling A-ASSOCIATE-RJ.
> Removed dead code to avoid warning.
> Initialize buffer to zero.
> Corrected handling of character set for HG images.
> Updated warning message.
> Fixed indentation.
> Fixed issue with defragmentTCP() in non-blocking mode on Windows, where the WSAEWOULDBLOCK return code was not properly handled in the past.
> Added CMake option DCMTK\_PORTABLE\_LINUX\_BINARIES.
> Replaced C\_CHAR\_UNSIGNED test by a compile-only one.
> Fixed further build error.
> Updated credits to include Segmed, Inc.
> Fixed various Doxygen warnings.
> Suppress warnings about attribute redeclaration.
> Fixed gcc -Wextrea warning caused by previous commit.
> Fixed warning caused by previous commit.
> Removed overly strict check in the JPEG decoder.
> Fixed typo.
> Fixed possible NULL pointer dereference.
> 
> Mathieu Malaterre (7):
> Extend JPEG parser to allow removal of COM segment
> Expose COM removal option to img2dcm
> Remove reference to the expired LZW patent from unisys
> Indicate that the input DICOM/JPEG-LS is not conforming
> Rework un-optimized huffman table checking of symbol table
> Clarify img2dcm documentation for JPEG+APP2 vs ICC Profile
> Document mechanism to add definition in CMake
> 
> Michael Onken (40):
> Updated version information for 3.6.6+ development.
> Fixed extra padding created for some segmentations.
> Removed USE\_STD\_CXX\_INLUDES.
> Try to fix build for 744a94 on some platforms.
> Try fixing C includes for old compilers.
> Replaced bzero() with memset().
> Updated dependencies.
> Fixed building for Apple M1.
> Fix for Big Endian systems. Removed retired tag.
> Fixed HL7HierarchicDesignatorMacro.
> Enforce wlmscpfs' sleeping options.
> Updated copyright date and docs.
> Fix appn/comment combination of img2dcm options.
> Removed unused function and applied formatting.
> Try fix dcmect\_tests for Big Endian platform.
> Added comment.
> Harmonize dictionary options.
> Fixed possible NULL pointer dereference.
> Fixed poss. NULL pointer dereference/double free.
> Added configure support for changes in a9697d
> Fixed bug introduced in a9697d.
> Fixed documentation.
> Print warning for old cmake dictionary options.
> Remove some typos in the codebase.
> Fixed bug when adding more than 65535 frames.
> Allow up to 2^31-1 frames in segmentations.
> Fixed build errors on some systems.
> Fixed build warnings.
> Fix some binary segmentation concatenations.
> Reformatted source code.
> Forbid insertion of encapsulated Pixel Data.
> Check return value for error.
> Fixed another issue with binary seg concatenations.
> Removed debug output.
> Fix for bug introduced in 1fd08a.
> Adapted DUL constant to reflect current behaviour
> Speed up dcmseg\_bigdim and only run with std::map.
> Remove debugging output introduced in last commit.
> Fixed test by removing retired attribute.
> Prepared DCMTK Release 3.6.7.
> 
> Nikolas Goldhammer (4):
> Fixed confusing value of Host Type on Windows.
> Fixed a warning in the FindOpenJPEG module.
> Added flag DCMTK\_USE\_OWN\_FINDOPENJPEG\_MODULE.
> Improved detection of additional depencencies for statically linking.
> 
> Tai Chi Minh Ralph Eastwood (1):
> Add pkg-config support to DCMTK
> \`\`\`

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 16, 2024, 7:28pm UTC](https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363/3 "2024-02-16T19:28:03Z")

</div>

I could help out with testing or if there is any specific issue to investigate, but in general @jcfr is probably the best person to work on this.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [February 16, 2024, 8:13pm UTC](https://discourse.slicer.org/t/slicer-dcmtk-needs-an-update/34363/4 "2024-02-16T20:13:48Z")

</div>

I will follow-up when I have an update 🚀
