Page MenuHomePhabricator | MITK

LabelSetImageIO should support time geomatries and property serialization
Open, Needs TriagePublic

Description

Current status:

  1. LabelSetImageIO ignores time geometry information. As a result the timing information gets lost when stored into a file and is a simple default PropertionalTimeGeometrie if loaded again.
  2. LabelSetImageIO does not support property serialization

To fixe that the Write() and Read() method of LabelSetImageIO should be extended by the same business logic used in ItkImageIO.
There the support is done in the following locations:

  • Write time geometry: mitkItkImageIO.cpp; lines 613 - 630
    // Handle time geometry
    const auto *arbitraryTG = dynamic_cast<const ArbitraryTimeGeometry *>(image->GetTimeGeometry());
    if (arbitraryTG)

[...]

      itk::EncapsulateMetaData<std::string>(
        m_ImageIO->GetMetaDataDictionary(), PROPERTY_KEY_TIMEGEOMETRY_TIMEPOINTS, data);
    }
  • Write properties: mitkItkImageIO.cpp; lines 632 - 655
    // Handle properties
    mitk::PropertyList::Pointer imagePropertyList = image->GetPropertyList();

[...]

    ImageReadAccessor imageAccess(image);
    LocaleSwitch localeSwitch2("C");
    m_ImageIO->Write(imageAccess.GetData());
  • Read tune geometry: mitkItkImageIO.cpp; lines 348 - 412
// re-initialize TimeGeometry
TimeGeometry::Pointer timeGeometry;
if (dictionary.HasKey(PROPERTY_NAME_TIMEGEOMETRY_TYPE) || dictionary.HasKey(PROPERTY_KEY_TIMEGEOMETRY_TYPE))

[...]

    timeGeometry = propTimeGeometry;
  }

  image->SetTimeGeometry(timeGeometry);
  • Read tune geometry: mitkItkImageIO.cpp; lines 348 - 412
  for (auto iter = dictionary.Begin(), iterEnd = dictionary.End(); iter != iterEnd;
       ++iter)
  {
    if (iter->second->GetMetaDataObjectTypeInfo() == typeid(std::string))

[...]

      if (!isDefaultKey)
      {
        mitk::CoreServices::GetPropertyPersistence()->AddInfo(info);
      }
    }
  }

Event Timeline

floca created this task.Tue, Feb 5, 11:02 AM