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

Function FindFirstDICOMProperty

Modules/PET/src/mitkSUVCalculationHelper.cpp:61–76  ·  view source on GitHub ↗

Pull the first matching property as a DICOMProperty so the caller can index by (timestep, slice). Returns nullptr if no match. Wraps mitk::GetPropertyByDICOMTagPath so per-slice access stays available alongside the simpler mitk::GetFirstDICOMValueAsString convenience.

Source from the content-addressed store, hash-verified

59 // mitk::GetPropertyByDICOMTagPath so per-slice access stays available
60 // alongside the simpler mitk::GetFirstDICOMValueAsString convenience.
61 const mitk::DICOMProperty* FindFirstDICOMProperty(
62 const mitk::IPropertyProvider* provider,
63 const mitk::DICOMTagPath& path)
64 {
65 const auto matches = mitk::GetPropertyByDICOMTagPath(provider, path);
66 if (matches.empty())
67 {
68 return nullptr;
69 }
70 if (matches.size() > 1)
71 {
72 MITK_WARN << "Multiple properties match DICOM tag path " << path.ToStr()
73 << "; using the first match: " << matches.begin()->first;
74 }
75 return dynamic_cast<const mitk::DICOMProperty*>(matches.begin()->second.GetPointer());
76 }
77
78 // Splice an optional date string and a time string into an OFDateTime.
79 // Returns true on success.

Callers 2

ResolveInjectionDateTimeFunction · 0.85
DeduceDecayCorrectionMethod · 0.85

Calls 4

GetPointerMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected