comparison 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
comparison
equal deleted inserted replaced
3014:b9f0b0c0b36f 3015:abe49ca61cd5
1067 ExtractMainDicomTagsInternal(other, ResourceType_Series); 1067 ExtractMainDicomTagsInternal(other, ResourceType_Series);
1068 ExtractMainDicomTagsInternal(other, ResourceType_Instance); 1068 ExtractMainDicomTagsInternal(other, ResourceType_Instance);
1069 } 1069 }
1070 1070
1071 1071
1072 bool DicomMap::HasOnlyMainDicomTags() const
1073 {
1074 // TODO - Speed up possible by making this std::set a global variable
1075
1076 std::set<DicomTag> mainDicomTags;
1077 GetMainDicomTags(mainDicomTags);
1078
1079 for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it)
1080 {
1081 if (mainDicomTags.find(it->first) == mainDicomTags.end())
1082 {
1083 return false;
1084 }
1085 }
1086
1087 return true;
1088 }
1089
1090
1072 void DicomMap::Serialize(Json::Value& target) const 1091 void DicomMap::Serialize(Json::Value& target) const
1073 { 1092 {
1074 target = Json::objectValue; 1093 target = Json::objectValue;
1075 1094
1076 for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it) 1095 for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it)