Mercurial > hg > orthanc-gdcm
changeset 91:a06bfd17987e
new default value for RestrictTransferSyntaxes: J2K transfer syntaxes if not defined
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 23 Jul 2024 12:01:55 +0200 |
parents | 6affa2fc9d39 |
children | e16068b079ab e1fc221e054a |
files | NEWS Plugin/Plugin.cpp |
diffstat | 2 files changed, 48 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Tue Jul 23 11:33:14 2024 +0200 +++ b/NEWS Tue Jul 23 12:01:55 2024 +0200 @@ -2,7 +2,24 @@ =============================== * Prevent transcoding of DICOM images with empty - SharedFunctionalGroupsSequence (5200,9229), as this might crash GDCM + SharedFunctionalGroupsSequence (5200,9229), as this might crash GDCM. +* The built-in Orthanc transcoder being usually more stable, the default + value of the "RestrictTransferSyntaxes" configuration has been updated + to configure the GDCM plugin for J2K transfer syntaxes only since these + transfer syntaxes are currently not supported by the built-in Orthanc + transcoder. + - If "RestrictTransferSyntaxes" is not specified in your configuration, + it is now equivalent to + "RestrictTransferSyntaxes" : [ + "1.2.840.10008.1.2.4.90", // JPEG 2000 Image Compression (Lossless Only) + "1.2.840.10008.1.2.4.91", // JPEG 2000 Image Compression + "1.2.840.10008.1.2.4.92", // JPEG 2000 Part 2 Multicomponent Image Compression (Lossless Only) + "1.2.840.10008.1.2.4.93" // JPEG 2000 Part 2 Multicomponent Image Compression + ] + which was the recommended configuration. + - If "RestrictTransferSyntaxes" is defined but empty, the GDCM plugin will + now be used to transcode ALL transfer syntaxes (this was the default + behaviour up to version 1.7) Version 1.7 (2024-05-06)
--- a/Plugin/Plugin.cpp Tue Jul 23 11:33:14 2024 +0200 +++ b/Plugin/Plugin.cpp Tue Jul 23 12:01:55 2024 +0200 @@ -547,18 +547,41 @@ enabled = config.GetBooleanValue(KEY_ENABLE_GDCM, true); - if (enabled && - config.LookupSetOfStrings(enabledTransferSyntaxes_, KEY_RESTRICT_TRANSFER_SYNTAXES, false)) + if (enabled) { - restrictTransferSyntaxes_ = true; - - for (std::set<std::string>::const_iterator it = enabledTransferSyntaxes_.begin(); - it != enabledTransferSyntaxes_.end(); ++it) + if (config.LookupSetOfStrings(enabledTransferSyntaxes_, KEY_RESTRICT_TRANSFER_SYNTAXES, false)) + { + if (enabledTransferSyntaxes_.size() == 0) + { + restrictTransferSyntaxes_ = false; + LOG(WARNING) << KEY_GDCM << "." << KEY_RESTRICT_TRANSFER_SYNTAXES << " configuration is set but empty, Orthanc will use GDCM to transcode ALL transfer syntaxes."; + } + else + { + LOG(WARNING) << KEY_GDCM << "." << KEY_RESTRICT_TRANSFER_SYNTAXES << " configuration is set and not empty, Orthanc will use GDCM to transcode SOME transfer syntaxes:"; + } + } + else { - LOG(WARNING) << "Orthanc will use GDCM to decode transfer syntax: " << *it; + LOG(WARNING) << KEY_GDCM << "." << KEY_RESTRICT_TRANSFER_SYNTAXES << " configuration is not set, using default configuration. Orthanc will use GDCM to transcode only J2K transfer syntaxes:"; + enabledTransferSyntaxes_.insert("1.2.840.10008.1.2.4.90"); // JPEG 2000 Image Compression (Lossless Only) + enabledTransferSyntaxes_.insert("1.2.840.10008.1.2.4.91"); // JPEG 2000 Image Compression + enabledTransferSyntaxes_.insert("1.2.840.10008.1.2.4.92"); // JPEG 2000 Part 2 Multicomponent Image Compression (Lossless Only) + enabledTransferSyntaxes_.insert("1.2.840.10008.1.2.4.93"); // JPEG 2000 Part 2 Multicomponent Image Compression + } + + if (enabledTransferSyntaxes_.size() > 0) + { + restrictTransferSyntaxes_ = true; + for (std::set<std::string>::const_iterator it = enabledTransferSyntaxes_.begin(); + it != enabledTransferSyntaxes_.end(); ++it) + { + LOG(WARNING) << "Orthanc will use GDCM to decode transfer syntax: " << *it; + } } } + unsigned int throttling; if (enabled && config.LookupUnsignedIntegerValue(throttling, KEY_THROTTLING))