| 305 | } |
| 306 | |
| 307 | void 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 | |
| 338 | std::string |
| 339 | mitk::TestDICOMLoading::trim(const std::string& pString, |
nothing calls this directly
no test coverage detected