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

Method AddPropertyToDump

Modules/DICOMTesting/src/mitkTestDICOMLoading.cpp:307–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307void mitk::TestDICOMLoading::AddPropertyToDump(const mitk::PropertyKeyPath& key, const mitk::Image* image, std::stringstream& result)
308{
309 auto propKey = mitk::PropertyKeyPathToPropertyName(key);
310 auto prop = image->GetProperty(propKey.c_str());
311 if (prop.IsNotNull())
312 {
313 auto value = prop->GetValueAsString();
314 auto dicomProp = dynamic_cast< mitk::DICOMProperty*>(prop.GetPointer());
315 if (dicomProp != nullptr)
316 {
317 auto strippedProp = dicomProp->Clone();
318 if (key == mitk::DICOMIOMetaInformationPropertyConstants::READER_FILES())
319 {//strip dicom file information from path to ensure generalized dump files
320 auto timePoints = strippedProp->GetAvailableTimeSteps();
321 for (auto timePoint : timePoints)
322 {
323 auto slices = strippedProp->GetAvailableSlices(timePoint);
324 for (auto slice : slices)
325 {
326 auto value = strippedProp->GetValue(timePoint, slice);
327 value = itksys::SystemTools::GetFilenameName(value);
328 strippedProp->SetValue(timePoint, slice, value);
329 }
330 }
331 }
332 value = mitk::PropertyPersistenceSerialization::serializeTemporoSpatialStringPropertyToJSON(strippedProp);
333 }
334 result << propKey << ": " << value << "\n";
335 }
336}
337
338std::string
339mitk::TestDICOMLoading::trim(const std::string& pString,

Callers

nothing calls this directly

Calls 10

IsNotNullMethod · 0.80
GetPointerMethod · 0.80
GetAvailableTimeStepsMethod · 0.80
GetAvailableSlicesMethod · 0.80
GetPropertyMethod · 0.45
GetValueAsStringMethod · 0.45
CloneMethod · 0.45
GetValueMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected