# HG changeset patch # User Sebastien Jodogne # Date 1596729370 -7200 # Node ID 1a26daefc3feaa3721cd4fe74ee49b69c7fb18ac # Parent 6774605d4341ac5349f94a6294c40d8d284927cb DicomImageInformation::USEFUL_TAG_LENGTH diff -r 6774605d4341 -r 1a26daefc3fe OrthancFramework/Sources/DicomFormat/DicomImageInformation.h --- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h Thu Aug 06 17:38:55 2020 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h Thu Aug 06 17:56:10 2020 +0200 @@ -30,6 +30,17 @@ { class ORTHANC_PUBLIC DicomImageInformation { + public: + /** + * This constant gives a bound on the maximum tag length that is + * useful to class "DicomImageInformation", in order to avoid + * using too much memory when copying DICOM tags from "DcmDataset" + * to "DicomMap" using "ExtractDicomSummary()". The value 256 + * corresponds to ORTHANC_MAXIMUM_TAG_LENGTH that was implicitly + * used in Orthanc <= 1.7.2. + **/ + static const unsigned int USEFUL_TAG_LENGTH = 256; + private: unsigned int width_; unsigned int height_; diff -r 6774605d4341 -r 1a26daefc3fe OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp --- a/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp Thu Aug 06 17:38:55 2020 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp Thu Aug 06 17:56:10 2020 +0200 @@ -358,7 +358,7 @@ // Extract information about the image structure DicomMap tags; std::set ignoreTagLength; - FromDcmtkBridge::ExtractDicomSummary(tags, dicom, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + FromDcmtkBridge::ExtractDicomSummary(tags, dicom, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength); DicomImageInformation information(tags); diff -r 6774605d4341 -r 1a26daefc3fe OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp --- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Thu Aug 06 17:38:55 2020 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Thu Aug 06 17:56:10 2020 +0200 @@ -251,7 +251,7 @@ DicomMap m; std::set ignoreTagLength; - FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength); /** * Create an accessor to the raw values of the DICOM image. @@ -324,7 +324,7 @@ { DicomMap m; std::set ignoreTagLength; - FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength); DicomImageInformation info(m); PixelFormat format; @@ -605,7 +605,7 @@ DicomMap m; std::set ignoreTagLength; - FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength); DicomImageInformation info(m); std::unique_ptr target(CreateImage(dataset, true));