| 412 | } |
| 413 | |
| 414 | itk::MetaDataObjectBase::Pointer ConvertTimePointListToMetaDataObject(const mitk::TimeGeometry* timeGeometry) |
| 415 | { |
| 416 | std::stringstream stream; |
| 417 | stream << timeGeometry->GetTimeBounds(0)[0]; |
| 418 | const auto maxTimePoints = timeGeometry->CountTimeSteps(); |
| 419 | for (TimeStepType pos = 0; pos < maxTimePoints; ++pos) |
| 420 | { |
| 421 | auto timeBounds = timeGeometry->GetTimeBounds(pos); |
| 422 | |
| 423 | /////////////////////////////////////// |
| 424 | // Workaround T27883. See https://phabricator.mitk.org/T27883#219473 for more details. |
| 425 | // This workaround should be removed as soon as T28262 is solved! |
| 426 | if (pos + 1 == maxTimePoints && timeBounds[0]==timeBounds[1]) |
| 427 | { |
| 428 | timeBounds[1] = timeBounds[0] + 1.; |
| 429 | } |
| 430 | // End of workaround for T27883 |
| 431 | ////////////////////////////////////// |
| 432 | |
| 433 | stream << " " << timeBounds[1]; |
| 434 | } |
| 435 | auto result = itk::MetaDataObject<std::string>::New(); |
| 436 | result->SetMetaDataObjectValue(stream.str()); |
| 437 | return result.GetPointer(); |
| 438 | }; |
| 439 | |
| 440 | PropertyList::Pointer ItkImageIO::ExtractMetaDataAsPropertyList(const itk::MetaDataDictionary& dictionary, const std::string& mimeTypeName, const std::vector<std::string>& defaultMetaDataKeys) |
| 441 | { |
no test coverage detected