Page MenuHomePhabricator

Segmentation interpolation does not work in dynamic images with t != 0
Closed, ResolvedPublic


It is not related to the latest changes in the release branch. Same applies for last snapshot installer and v2018.04.

  • Set a dynamic reference image like U4DCyl.nrrd
    • Static segmentation
      • t = 0
        • Preview works, resulting surface works but has default geometry with 1 time step starting at 0 with 1ms duration
      • t > 0
        • Preview only shown in t = 0, same for result
    • Dynamic segmentation
      • t = 0
        • Preview works, resulting surface works but has default geometry with 1 time step starting at 0 with 1ms duration
      • t > 0
        • Preview works, resulting surface has as many time steps as the one where the interpolation was done. For example: interpolation done in t=1, but image has 4 timesteps. Surface has 2 time steps.

The resulting surface is always overridden. Even if it is renamed in between interpolations! Interpolation surfaces in other time steps are not preserved, i.e. one can only have a surface in a single time step.

This also reveals another bug in the 2-d surface mapper. While the 3-d surface mapper correctly shows a surface in a certain time step, the 2-d mapper shows the surface for all time steps. But only after it has been viewed in the correct time step.

I also got twice an unknown exception while playing around with interpolation, segmentation, and time steps with 3D+Heart, but I cannot reproduce it.

Event Timeline

kislinsk triaged this task as Unbreak Now! priority.Feb 4 2021, 1:28 AM
kislinsk created this task.

As it is no regression since the last release but seems to be a longer issue (or always was one), I would think about completly deactivating interpolation for dynamic images for now and mark it as known issue. I am hesitant to dive in the whole interpolation condundrum for the release. I would tend to discuss it in context our segmentation roadmap this year.

Diving into it, it turned out to be not that hard to fix as it was just the combination of two "bugs/missing features" that appeared to be so chaotic without knowing the interference of both issues.

  • First fix: Mimic segmentation geometries in interpolation surface geometries. Interpolation was already partly aware of time steps but not completely of time points and durations.
  • Second fix: 2-d surface mapper did not hide anything as soon as input was invalid nor did it check correctly if the surface is visible at the current world geometry time step. Latter part is also true for 3-d surfaces.

I also changed the actual interpolation result surface to always be a static surface at the correct time point, instead of a dynamic surface. We cannot really serialize dynamic surfaces (also during lack of file format capabilities) and as the result surface is supposed to be a permanent scene entity it made more sense to create static surfaces. If they originate from a dynamic segmentation, their name now have an appropriate suffix indicating the originating time step. For example, a scene looks like this now, if two different time steps were interpolated:

  • PatientImage
    • DynamicSegmentation
      • DynamicSegmentation_3D-interpolation_t0
      • DynamicSegmentation_3D-interpolation_t3
    • StaticSegmentation
      • StaticSegmentation_3D-interpolation

I tested it very thoroughly during the whole day and it works like a charm.

There's only one thing missing that I will try to fix now. Even though the results are now static surfaces, we still cannot serialize any time-related information so for example, after re-loading a scene file, they have a default time geometry again.

Serializing dynamic surfaces is something that we can discuss after release. Unfortunately first proposals were declined already many years ago but I think decision makers are now more open-minded than back then. :-D

Deleted branch from rMITK MITK: bugfix/T28271-3DInterpolation.