Page MenuHomePhabricator

[Segmentation] 2-d interpolation does not interpolate between multiple slices
Open, NormalPublic

Description

  • Create a segmentation
  • Activate 2-d interpolation
  • Draw 3 contours for Label 1 in 3 different slices in a single render window with some gaps in between
  • Click "Confirm for all slices" for the chosen render window
  • Only one of the two gaps is actually filled with the interpolation result (expected: all gaps should be filled)
  • Another click on "Confirm for all slices" fills the other gap

Another interesting observation:

  • Do the same as above but after the 3rd contour scroll back in between the last 2 drawn contours to add a 4th contour.
  • "Confirm for all slices" works as expected

Event Timeline

kislinsk triaged this task as Unbreak Now! priority.Thu, May 2, 4:42 PM
kislinsk created this task.

Was this also a problem in the last release?

This can be also reproduced with just two slices. The crux is to stay at the last drawn contour and that the 2-d interpolation is activated already before drawing contours.

The bookkeeping of the SegmentationInterpolationController for existing segmentations in slices is not updated in that case. The interpolation itself is then looking for the lower and upper bounds for each slice and since the last segmented slice is not yet captured, the actual upper bound is not found in all cases, in which case no interpolation is happening (for the last gap between segmented slices).

So, when is the bookkeeping updated? - When you navigate to another slice.

And here I found another issue, which does not produce wrong results but massively (!!) slows down scrolling through slices while the 2-d interpolation is active:

Every single time while scrolling through slices QmitkSlicesInterpolator::On2DInterpolationEnabled() is triggered again which completely initializes the whole interpolator from scratch including a call to SetSegmentationVolume(). Hence the whole segmentation image is completely iterated through pixel-wise to count segmentation pixels per slice over and over again.

thanks for the research. Are you already working on that ticket?

I also peeked into the code base. And as also 2D is a mess 🙈.
It would make sense to completle rework and align it with the chaching mechanism of the surface interpolation controler (may be refactor it to use the same interpolation base class or just cover both use cases in the same controller class, because the only difference is the interpolation strategy (generate surface or slice interpolations along a plane normal, and over a method for doing 2D interpolations).
Therfore I am inclined to opt for the following:

  • Only fix somethin, if we have a workaround/option with minimal intervention. If not keep it as known issue or deactivate 2D interpolation in this release.
  • Rework it after the 2024-06 release for good.

thanks for the research. Are you already working on that ticket?

No, not working on it currently.

a178n lowered the priority of this task from Unbreak Now! to Normal.Wed, May 8, 10:34 AM
a178n edited projects, added Next Milestone, MITK; removed Checklist, MITK (v2024.06).