Page MenuHomePhabricator

[Segmentation] Region growing does not work if seed point is already inside a segmentation
Closed, ResolvedPublic

Description

  • v2021.02 and v2018.04 (Windows)

Steps to reproduce

  • Load an image
  • Create a segmentation with the segmentation plugin
  • Mark any region with any tool
  • Select region growing and click within the already segmented region

-> Nothing happens (only works outside the already segmented region)

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

s434n triaged this task as Normal priority.Feb 19 2021, 10:39 AM
s434n created this task.

I started looking into this and what I found inside mitk::RegionGrowingTool::OnMousePressed:

if (inside)
      {
        MITK_DEBUG << "Clicked inside segmentation";
        // For now, we're doing nothing when the user clicks inside the segmentation. Behaviour can be implemented via
        // OnMousePressedInside()
        // When you do, be sure to remove the m_PaintingPixelValue check in OnMouseMoved() and OnMouseReleased()
        return;
      }
      else
      {
        MITK_DEBUG << "Clicked outside of segmentation";
        OnMousePressedOutside(nullptr, interactionEvent);
      }

Looking at the file history it doesn't look like that was implemented in MITK at anytime.
So we can actually discuss if we want to allow such a functionality and if, what the obstacles are.

I quickly modified the code to see if this works potentially. For this I set m_PaintingPixelValue to 1 for both cases and used the OnMousePressedOutside-function also for a mouse pressed inside:

m_PaintingPixelValue = inside ? 1 : 1;

      if (inside)
      {
        MITK_DEBUG << "Clicked inside segmentation";
        // For now, we're doing nothing when the user clicks inside the segmentation. Behaviour can be implemented via
        // OnMousePressedInside()
        // When you do, be sure to remove the m_PaintingPixelValue check in OnMouseMoved() and OnMouseReleased()
        OnMousePressedOutside(nullptr, interactionEvent);
        return;
      }
      else
      {
        MITK_DEBUG << "Clicked outside of segmentation";
        OnMousePressedOutside(nullptr, interactionEvent);
      }

This probably needs to be tested thoroughly with 3D-/4D-Data, with static and dynamic segmentations and multi label. What do you think, @floca?

Hm, due to the facts that (1) the feature is missing since 2016 and no one ever complaint, (2) it is not documented in the help and (3) I am not sure why one would like to behave differently when clicking in an area that is segmented, I would just skip the code path. Yes.
But I would go further then. You don't need the whole inside check any more. I would completly remove everythin below line 332 and directly call OnMousePressedOutside(nullptr, interactionEvent); then.

This issue should be postponed until T28523: Evaluate MITK segmentation survey (to now the new priority) is done.

@floca, should we also add this for the upcoming release?

@floca, should we also add this for the upcoming release?

Is there already an task branch ready to land? If not I think it is unrealistic to bring it in the next release, as either the release branch is already forked or will be any minute or so...
And I would not break the time based pattern.

kalali moved this task from Segmentation to Cycle on the MITK (v2022.04) board.
kalali added a revision: Restricted Differential Revision.