Page MenuHomePhabricator

[MultiLabel Segmentation] Creating a segmentation "as new segmentation" fails
Closed, ResolvedPublic


The workbench crashes when creating a new segmentation node using the 3D tools and the option "Create as new segmentation".
This only happens in some cases, one way to reproduce this is the following:

  1. Start the MITK workbench, open the Segmentation view
  2. Load a 3D image and create a new segmentation node
  3. Create two labels on the labelsetimage / segmentation node
  4. Select the second one and start a Threshold segmentation
  5. Check the "Create as new segmentation" checkbox
  6. Click "Confirm Segmentation"
  7. An error message appears, stating
Error accessing single time steps of the original image. Cannot create segmentation.

The exception states (log output / error message details):

MITK Exception: Description: Invalid call of TransferLabelContent. Defined destination label does not exist in destinationImage. newDestinationLabel: 2 Filename: C:\jenkins\MITK\snap\src\MITK\Modules\Segmentation\Interactions\mitkAutoSegmentationWithPreviewTool.cpp Line: 729

Revisions and Commits


Event Timeline

kalali triaged this task as High priority.Apr 26 2022, 5:32 PM
kalali created this task.

damn I know the reason. At least I have made a telling exception. ๐Ÿ˜…

kalali renamed this task from [MultiLabel Segmentation] Creating a to [MultiLabel Segmentation] Creating a segmentation "as new segmentation" fails.Apr 26 2022, 5:44 PM

damn I know the reason. At least I have made a telling exception. ๐Ÿ˜…

Nice, so nothing to worry then? ๐Ÿ˜… Please commit your fix into the new release branch release/T29138-v2022.04.

kislinsk raised the priority of this task from High to Unbreak Now!.Apr 27 2022, 10:16 AM

I cannot reproduce the crash with the related branch!

However, when I create two labels and use the threshold on the second one while having the "Create as new segmentation" checkbox checked, the new node (named <image_name>_Threshold) contains both labels / both masks, so the mask of the first label (yellow) is also included, although the second mask (red) is the one I used (and it is also correctly created by the threshold tool).

I was able to reproduce the problem on the snapshot from two days ago. This new version fixes the problem for me, although the behavior is the same as @kalali described it. The newly created segmentation is a complete copy of the current one (including layers, labels, and masked regions of the labels), except for the changed region that was just segmented. I'm not sure if this is the expected behavior, but if it is everything seems to work fine.

Thank you for spotting that. It is not expected behavior. But I would keep as is (known issue). 1) I think it is acceptable and 2) to handle this properly and not hacky, would be very intrusive and take 1 day. I would prefer to do it when the AutoTool classes will be merged and refined anyways, then it is an quite easy catch.
@kislinsk What do you think?