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

Function CopyIfPresent

Modules/Multilabel/src/mitkDICOMSegmentationPropertyHelper.cpp:142–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140namespace
141{
142 void CopyIfPresent(mitk::MultiLabelSegmentation* seg,
143 const mitk::IPropertyProvider* source,
144 unsigned int group, unsigned int element,
145 bool overwrite)
146 {
147 const auto key = mitk::GeneratePropertyNameForDICOMTag(group, element);
148 const auto sourceProp = source->GetConstProperty(key);
149 if (sourceProp.IsNull())
150 return;
151 if (!overwrite && seg->GetConstProperty(key).IsNotNull())
152 return;
153 seg->SetProperty(key.c_str(), sourceProp->Clone());
154 }
155}
156
157void mitk::DICOMSegmentationPropertyHelper::InheritPatientFromSource(MultiLabelSegmentation* seg,

Calls 5

IsNotNullMethod · 0.80
GetConstPropertyMethod · 0.45
IsNullMethod · 0.45
SetPropertyMethod · 0.45
CloneMethod · 0.45

Tested by

no test coverage detected