Mercurial > hg > orthanc
diff OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 5788:61c9e5df64d7 find-refactoring
handling of sequences from DB in RequestedTags
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 17 Sep 2024 16:17:53 +0200 |
parents | f7adfb22e20e |
children | a3d283f61304 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Tue Sep 17 12:48:51 2024 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Tue Sep 17 16:17:53 2024 +0200 @@ -667,13 +667,16 @@ } - void DicomMap::CopyTagIfExists(const DicomMap& source, + bool DicomMap::CopyTagIfExists(const DicomMap& source, const DicomTag& tag) { if (source.HasTag(tag)) { SetValue(tag, source.GetValue(tag)); + return true; } + + return false; } @@ -736,6 +739,21 @@ } } + void DicomMap::RemoveComputedTags(std::set<DicomTag>& tags) + { + std::set<DicomTag> tagsToRemove; + + for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) + { + if (IsComputedTag(*it)) + { + tagsToRemove.insert(*it); + } + } + + Toolbox::RemoveSets(tags, tagsToRemove); + } + bool DicomMap::HasOnlyComputedTags(const std::set<DicomTag>& tags) { if (tags.size() == 0)