Medical Imaging Interaction Toolkit  2018.4.99-07c45cb1
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkDICOMProperty.h"
14 
15 
18 {
19  const auto& lookupTable = cacheLookupTable.GetLookupTable();
21 
22  for (auto element : lookupTable)
23  {
24  prop->SetValue(element.second.TimePoint, element.second.SliceInTimePoint, element.second.Value);
25  }
26 
27  return prop.GetPointer();
28 }
29 
30 std::map< std::string, mitk::BaseProperty::Pointer> mitk::GetPropertyByDICOMTagPath(const mitk::PropertyList* list, const mitk::DICOMTagPath& path)
31 {
32  std::map< std::string, mitk::BaseProperty::Pointer> result;
33 
34  for (const auto& iter : *(list->GetMap()))
35  {
36  DICOMTagPath propPath = PropertyNameToDICOMTagPath(iter.first);
37  if (!propPath.IsEmpty() && path.Equals(propPath))
38  {
39  result.insert(iter);
40  }
41  }
42  return result;
43 };
44 
45 std::map< std::string, mitk::BaseProperty::Pointer> mitk::GetPropertyByDICOMTagPath(const mitk::BaseData* data, const mitk::DICOMTagPath& path)
46 {
47  std::map< std::string, mitk::BaseProperty::Pointer> result;
48 
49  if (data)
50  {
51  result = GetPropertyByDICOMTagPath(data->GetPropertyList(), path);
52  }
53 
54  return result;
55 };
Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag...
Base of all data objects.
Definition: mitkBaseData.h:37
bool Equals(const DICOMTagPath &path) const
Key-value list holding instances of BaseProperty.
MITKDICOMREADER_EXPORT mitk::BaseProperty::Pointer GetDICOMPropertyForDICOMValuesFunctor(const DICOMCachedValueLookupTable &cacheLookupTable)
const LookupTableType & GetLookupTable() const
mitk::PropertyList::Pointer GetPropertyList() const
Get the data&#39;s property list.
MITKDICOMREADER_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string &propertyName)
MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer > GetPropertyByDICOMTagPath(const PropertyList *list, const DICOMTagPath &path)
const PropertyMap * GetMap() const