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

Method AdoptReferenceDICOMProperty

Modules/DICOMQI/src/mitkDICOMQIPropertyHelper.cpp:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 void DICOMQIPropertyHelper::AdoptReferenceDICOMProperty(PropertyList *referencedPropertyList,
77 PropertyList *propertyList,
78 const DICOMTag &tag,
79 const std::string &defaultString)
80 {
81 std::string tagString = GeneratePropertyNameForDICOMTag(tag.GetGroup(), tag.GetElement());
82
83 if (auto* property = propertyList->GetProperty(tagString); property != nullptr)
84 return; // Do not override existing DICOM information (T29431)
85
86 // Get DICOM property from referenced image
87 BaseProperty::Pointer originalProperty = referencedPropertyList->GetProperty(tagString.c_str());
88
89 // if property exists, copy the informtaion to the derived image
90 if (originalProperty.IsNotNull())
91 propertyList->SetProperty(tagString.c_str(), originalProperty);
92 else // use the default value, if there is one
93 {
94 if (!defaultString.empty())
95 propertyList->SetProperty(tagString.c_str(), TemporoSpatialStringProperty::New(defaultString).GetPointer());
96 }
97 }
98}

Callers

nothing calls this directly

Calls 8

IsNotNullMethod · 0.80
GetPointerMethod · 0.80
NewFunction · 0.50
GetGroupMethod · 0.45
GetElementMethod · 0.45
GetPropertyMethod · 0.45
SetPropertyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected