Page MenuHomePhabricator

LabelSetImageIO should support time geometries and property serialization
Closed, ResolvedPublic

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 time 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 time 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);
      }
    }
  }

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

floca created this task.Feb 5 2019, 11:02 AM
kislinsk edited projects, added MITK; removed MITK (2018-04).Mar 11 2019, 9:32 AM
kislinsk triaged this task as High priority.Mar 15 2019, 11:30 AM
kislinsk removed a project: Request for Discussion.
kislinsk added a subscriber: kislinsk.

This is important to be fixed soon-ish. Potential candidate for the next bugfix release.

hettich renamed this task from LabelSetImageIO should support time geomatries and property serialization to LabelSetImageIO should support time geometries and property serialization.Mar 22 2019, 5:33 PM
floca updated the task description. (Show Details)Apr 29 2019, 9:42 AM
kislinsk edited projects, added MITK; removed MITK (2018-04-4).Feb 11 2020, 4:42 PM
floca edited projects, added MITK (2020); removed MITK.Mar 6 2020, 3:45 PM
floca added a revision: Restricted Differential Revision.Apr 1 2020, 5:59 PM
kislinsk moved this task from Backlog to Segmentation on the MITK (2020) board.Apr 2 2020, 2:57 PM
floca closed this task as Resolved.Apr 2 2020, 4:54 PM
floca claimed this task.
floca added subscribers: gaoh, thomass, nolden.

@nolden @gaoh @thomass First step to the long road to DICOM Seg. Now at least multi lable images stored as nrrd contain all (dicom) properties needed to write DICOM Seg. Till now only projects files have everything to allow the reconstrution of a state to write DICOM Seg.