Medical Imaging Interaction Toolkit  2018.4.99-c7ee88da
Medical Imaging Interaction Toolkit
mitkDICOMProperty.h
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 #ifndef mitkDICOMProperty_h
14 #define mitkDICOMProperty_h
15 
18 #include "mitkDICOMTagPath.h"
19 
20 #include "MitkDICOMReaderExports.h"
21 
22 namespace mitk
23 {
24 
26 
29 
30 
31  class PropertyList;
32  class BaseData;
33 
36  MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const PropertyList* list, const DICOMTagPath& path);
39  MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const BaseData* data, const DICOMTagPath& path);
40 
48  template<typename TNumericReturnType>
49  TNumericReturnType ConvertDICOMStrToValue(const std::string& dcmValueString)
50  {
51  std::istringstream iss(dcmValueString);
52  iss.imbue(std::locale("C"));
53  TNumericReturnType d;
54  if (!(iss >> d) || !(iss.eof()))
55  {
56  mitkThrow() << "Cannot convert string to value type. Type: " << typeid(TNumericReturnType).name() << "; String: " << dcmValueString;
57  }
58 
59  return d;
60  };
61 
62 
63 }
64 
65 #endif
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
#define MITKDICOMREADER_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Key-value list holding instances of BaseProperty.
MITKDICOMREADER_EXPORT mitk::BaseProperty::Pointer GetDICOMPropertyForDICOMValuesFunctor(const DICOMCachedValueLookupTable &cacheLookupTable)
#define mitkThrow()
TemporoSpatialStringProperty DICOMProperty
TNumericReturnType ConvertDICOMStrToValue(const std::string &dcmValueString)
MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer > GetPropertyByDICOMTagPath(const PropertyList *list, const DICOMTagPath &path)
Property for time and space resolved string values.