Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDICOMProperty.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkDICOMProperty.h"
18 
19 
22 {
23  const auto& lookupTable = cacheLookupTable.GetLookupTable();
25 
26  for (auto element : lookupTable)
27  {
28  prop->SetValue(element.second.TimePoint, element.second.SliceInTimePoint, element.second.Value);
29  }
30 
31  return prop.GetPointer();
32 }
33 
34 std::map< std::string, mitk::BaseProperty::Pointer> mitk::GetPropertyByDICOMTagPath(const mitk::PropertyList* list, const mitk::DICOMTagPath& path)
35 {
36  std::map< std::string, mitk::BaseProperty::Pointer> result;
37 
38  for (const auto& iter : *(list->GetMap()))
39  {
40  DICOMTagPath propPath = PropertyNameToDICOMTagPath(iter.first);
41  if (!propPath.IsEmpty() && path.Equals(propPath))
42  {
43  result.insert(iter);
44  }
45  }
46  return result;
47 };
48 
49 std::map< std::string, mitk::BaseProperty::Pointer> mitk::GetPropertyByDICOMTagPath(const mitk::BaseData* data, const mitk::DICOMTagPath& path)
50 {
51  std::map< std::string, mitk::BaseProperty::Pointer> result;
52 
53  if (data)
54  {
55  result = GetPropertyByDICOMTagPath(data->GetPropertyList(), path);
56  }
57 
58  return result;
59 };
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag...
bool Equals(const DICOMTagPath &path) const
Base of all data objects.
Definition: mitkBaseData.h:39
Key-value list holding instances of BaseProperty.
MITKDICOMREADER_EXPORT mitk::BaseProperty::Pointer GetDICOMPropertyForDICOMValuesFunctor(const DICOMCachedValueLookupTable &cacheLookupTable)
mitk::PropertyList::Pointer GetPropertyList() const
Get the data's property list.
MITKDICOMREADER_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string &propertyName)
const LookupTableType & GetLookupTable() const
MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer > GetPropertyByDICOMTagPath(const PropertyList *list, const DICOMTagPath &path)
const PropertyMap * GetMap() const