Page MenuHomePhabricator

[Segmentation] [Interpolation] "Confirm for single slice" always uses first label
Closed, ResolvedPublic

Description

When using the 2D interpolation in the Segmentation view, pressing "Confirm for single slice" does not fill the previewed interpolation of the current slice with the correct value. It always uses Label 1 (even if it has been deleted).

Steps to reproduce:

  • load any image and create a segmentation
  • add at least one more label
  • with not the first label active, segment something in two different non-adjacent slices and turn on 2D interpolation, so there is a preview shown in the in-between slices
  • click "Confirm for single slice"

-> The preview is filled out in the color of Label 1, regardless of which label is currently active

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

s434n triaged this task as High priority.Apr 13 2023, 5:15 PM
s434n created this task.
s434n updated the task description. (Show Details)
This comment was removed by s434n.

There are more issues like the interpolated slice is completely overriden, even if content of other labels are already present in the slice. In contrast, AcceptAllInterpolations() works in all conditions so we should probably also implement OnAcceptInterpolationClicked() in terms of AcceptAllInterpolations(), resp. refactor it into a common method that can be used by both single and all slices interpolation.

kislinsk added a subscriber: kislinsk.

Blocked by {D795}.

Definetly the interpolator has to rework and the different accept function refactored/streamlined.

To the problem of the task. I guess the results of the InterpolationController are always binary, so have the pixel value 1.

QmitkSlicesInterpolator::Interpolate line 848ff directly copies the binary result into m_FeedbackNode.

OnAcceptInterpolationClicked (line 932) directly uses this image to modify the segmentation. Therefore always 1s are added to the segmentation and only Label 1 is modified.

The whole boiler plate code should be removed and static SegTool2D::WriteBackSegmentationResult(...) should be used. Before that it has to be ensured that the FeedbackNode content has been changed to the right pixel value. E.G. with TransferLabelImageContent mapping from 1 to the active label value.

Damn... if I just would have more time...
May be it helps you

s434n added a revision: Restricted Differential Revision.Apr 28 2023, 4:46 PM

I have added a fix for this in D810. It only includes a fix to OnAcceptInterpolationClicked and does not refactor AcceptAllInterpolations, which is still quite clunky. But this should at least solve the buggy behavior.