Mercurial > hg > orthanc
diff Core/DicomFormat/DicomMap.cpp @ 3015:abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 14 Dec 2018 12:10:03 +0100 |
parents | 0e1755e5efd0 |
children | 4e43e67f8ecf |
line wrap: on
line diff
--- a/Core/DicomFormat/DicomMap.cpp Thu Dec 13 17:58:27 2018 +0100 +++ b/Core/DicomFormat/DicomMap.cpp Fri Dec 14 12:10:03 2018 +0100 @@ -1069,6 +1069,25 @@ } + bool DicomMap::HasOnlyMainDicomTags() const + { + // TODO - Speed up possible by making this std::set a global variable + + std::set<DicomTag> mainDicomTags; + GetMainDicomTags(mainDicomTags); + + for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it) + { + if (mainDicomTags.find(it->first) == mainDicomTags.end()) + { + return false; + } + } + + return true; + } + + void DicomMap::Serialize(Json::Value& target) const { target = Json::objectValue;