MCPcopy Create free account
hub / github.com/MITK/MITK / GetFirstDICOMValueAsString

Method GetFirstDICOMValueAsString

Modules/DICOM/src/mitkDICOMProperty.cpp:57–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57std::string
58mitk::GetFirstDICOMValueAsString(const mitk::IPropertyProvider* provider, const mitk::DICOMTagPath& path)
59{
60 const auto matches = GetPropertyByDICOMTagPath(provider, path);
61 if (matches.empty())
62 {
63 return {};
64 }
65 const auto& baseProp = matches.begin()->second;
66 const auto* dicomProp =
67 dynamic_cast<const mitk::DICOMProperty*>(baseProp.GetPointer());
68 if (nullptr != dicomProp)
69 {
70 return dicomProp->GetValue(0, 0, true, true);
71 }
72 // Not a TemporoSpatialStringProperty (e.g. a uniform-value StringProperty
73 // produced for a tag whose value is constant across all slices): fall back
74 // to the generic string accessor so the helper works for any property kind
75 // an IPropertyProvider may carry, not only the DICOM reader's output.
76 return baseProp->GetValueAsString();
77}

Callers

nothing calls this directly

Calls 5

GetPointerMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
GetValueMethod · 0.45
GetValueAsStringMethod · 0.45

Tested by

no test coverage detected