Mercurial > hg > orthanc
diff Core/DicomFormat/DicomMap.cpp @ 567:c2be0a0e049e find-move-scp
cont
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 19 Sep 2013 17:43:38 +0200 |
parents | f64e3838d6e1 |
children | 08eca5d86aad |
line wrap: on
line diff
--- a/Core/DicomFormat/DicomMap.cpp Wed Sep 18 16:58:27 2013 +0200 +++ b/Core/DicomFormat/DicomMap.cpp Thu Sep 19 17:43:38 2013 +0200 @@ -331,4 +331,59 @@ IsMainDicomTag(tag, ResourceType_Series) || IsMainDicomTag(tag, ResourceType_Instance)); } + + + void DicomMap::GetMainDicomTagsInternal(std::set<DicomTag>& result, ResourceType level) + { + DicomTag *tags = NULL; + size_t size; + + switch (level) + { + case ResourceType_Patient: + tags = patientTags; + size = sizeof(patientTags) / sizeof(DicomTag); + break; + + case ResourceType_Study: + tags = studyTags; + size = sizeof(studyTags) / sizeof(DicomTag); + break; + + case ResourceType_Series: + tags = seriesTags; + size = sizeof(seriesTags) / sizeof(DicomTag); + break; + + case ResourceType_Instance: + tags = instanceTags; + size = sizeof(instanceTags) / sizeof(DicomTag); + break; + + default: + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + + for (size_t i = 0; i < size; i++) + { + result.insert(tags[i]); + } + } + + + void DicomMap::GetMainDicomTags(std::set<DicomTag>& result, ResourceType level) + { + result.clear(); + GetMainDicomTagsInternal(result, level); + } + + + void DicomMap::GetMainDicomTags(std::set<DicomTag>& result) + { + result.clear(); + GetMainDicomTagsInternal(result, ResourceType_Patient); + GetMainDicomTagsInternal(result, ResourceType_Study); + GetMainDicomTagsInternal(result, ResourceType_Series); + GetMainDicomTagsInternal(result, ResourceType_Instance); + } }