# HG changeset patch # User Sebastien Jodogne # Date 1596731147 -7200 # Node ID a4f28efdfccfe8b3e3b387f9994de09cd0e0f37e # Parent 1a26daefc3feaa3721cd4fe74ee49b69c7fb18ac "maxTagLength" must be explicitly given to ParsedDicomFile::ExtractDicomSummary() diff -r 1a26daefc3fe -r a4f28efdfccf OrthancFramework/Sources/DicomParsing/DicomModification.cpp --- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -1006,7 +1006,7 @@ // is provided if (identifierGenerator_ != NULL) { - toModify.ExtractDicomSummary(currentSource_); + toModify.ExtractDicomSummary(currentSource_, ORTHANC_MAXIMUM_TAG_LENGTH); } // (1) Make sure the relationships are updated with the ids that we force too diff -r 1a26daefc3fe -r a4f28efdfccf OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp --- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -1655,18 +1655,21 @@ } - void ParsedDicomFile::ExtractDicomSummary(DicomMap& target) const + void ParsedDicomFile::ExtractDicomSummary(DicomMap& target, + unsigned int maxTagLength) const { std::set ignoreTagLength; FromDcmtkBridge::ExtractDicomSummary(target, *GetDcmtkObject().getDataset(), - ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + maxTagLength, ignoreTagLength); } void ParsedDicomFile::ExtractDicomSummary(DicomMap& target, + unsigned int maxTagLength, const std::set& ignoreTagLength) const { - FromDcmtkBridge::ExtractDicomSummary(target, *GetDcmtkObject().getDataset(), ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); + FromDcmtkBridge::ExtractDicomSummary(target, *GetDcmtkObject().getDataset(), + maxTagLength, ignoreTagLength); } diff -r 1a26daefc3fe -r a4f28efdfccf OrthancFramework/Sources/DicomParsing/ParsedDicomFile.h --- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.h Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.h Thu Aug 06 18:25:47 2020 +0200 @@ -244,9 +244,21 @@ void ChangeEncoding(Encoding target); - void ExtractDicomSummary(DicomMap& target) const; + /** + * The DICOM tags with a string whose size is greater than + * "maxTagLength", are replaced by a DicomValue whose type is + * "DicomValue_Null". If "maxTagLength" is zero, all the leaf tags + * are included, independently of their length. + **/ + void ExtractDicomSummary(DicomMap& target, + unsigned int maxTagLength) const; + /** + * This flavor can be used to bypass the "maxTagLength" limitation + * on a selected set of DICOM tags. + **/ void ExtractDicomSummary(DicomMap& target, + unsigned int maxTagLength, const std::set& ignoreTagLength) const; bool LookupTransferSyntax(std::string& result); diff -r 1a26daefc3fe -r a4f28efdfccf OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -572,7 +572,7 @@ * interpretation, and with windowing parameters. **/ ServerContext::DicomCacheLocker locker(context, publicId); - locker.GetDicom().ExtractDicomSummary(dicom); + locker.GetDicom().ExtractDicomSummary(dicom, ORTHANC_MAXIMUM_TAG_LENGTH); } } catch (OrthancException& e) diff -r 1a26daefc3fe -r a4f28efdfccf OrthancServer/Sources/QueryRetrieveHandler.cpp --- a/OrthancServer/Sources/QueryRetrieveHandler.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancServer/Sources/QueryRetrieveHandler.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -37,7 +37,6 @@ #include "OrthancConfiguration.h" #include "../../OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.h" -#include "../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h" #include "../../OrthancFramework/Sources/Logging.h" #include "../../OrthancFramework/Sources/Lua/LuaFunctionCall.h" #include "LuaScripting.h" @@ -160,7 +159,7 @@ size_t i) { Run(); - answers_.GetAnswer(i).ExtractDicomSummary(target); + answers_.GetAnswer(i).ExtractDicomSummary(target, 0 /* don't truncate tags */); } diff -r 1a26daefc3fe -r a4f28efdfccf OrthancServer/Sources/ServerIndex.cpp --- a/OrthancServer/Sources/ServerIndex.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancServer/Sources/ServerIndex.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -2468,7 +2468,7 @@ void ServerIndex::ReconstructInstance(ParsedDicomFile& dicom) { DicomMap summary; - dicom.ExtractDicomSummary(summary); + dicom.ExtractDicomSummary(summary, ORTHANC_MAXIMUM_TAG_LENGTH); DicomInstanceHasher hasher(summary); diff -r 1a26daefc3fe -r a4f28efdfccf OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp --- a/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -201,7 +201,7 @@ { ServerContext::DicomCacheLocker locker(GetContext(), instances.front()); - locker.GetDicom().ExtractDicomSummary(dicom); + locker.GetDicom().ExtractDicomSummary(dicom, ORTHANC_MAXIMUM_TAG_LENGTH); } const std::set moduleTags = removals_; diff -r 1a26daefc3fe -r a4f28efdfccf OrthancServer/Sources/ServerToolbox.cpp --- a/OrthancServer/Sources/ServerToolbox.cpp Thu Aug 06 17:56:10 2020 +0200 +++ b/OrthancServer/Sources/ServerToolbox.cpp Thu Aug 06 18:25:47 2020 +0200 @@ -269,7 +269,7 @@ // Update the tags of this resource DicomMap dicomSummary; - dicom.ExtractDicomSummary(dicomSummary); + dicom.ExtractDicomSummary(dicomSummary, ORTHANC_MAXIMUM_TAG_LENGTH); database.ClearMainDicomTags(resource);