Page MenuHomePhabricator

Multilabel Segmentation Utilities do not work for multilabel segmentations
Closed, ResolvedPublic

Assigned To
Authored By
May 25 2021, 11:13 AM
Referenced Files
F2460962: image.png
Oct 28 2021, 11:46 AM
F2460955: image.png
Oct 28 2021, 11:46 AM
F2460964: image.png
Oct 28 2021, 11:46 AM
F2460953: image.png
Oct 28 2021, 11:46 AM
F2285007: image.png
May 25 2021, 11:14 AM
F2284990: tomo02_patch000_add_0000.nii.gz
May 25 2021, 11:13 AM
F2284991: tomo02_patch000_remove_0000.nii.gz
May 25 2021, 11:13 AM
F2284989: tomo02_patch000.nii.gz
May 25 2021, 11:13 AM


I have a (multilabel) segmentation that I would like to correct (tomo02_patch000). The part labeled in tomo02_patch000_add_0000 needs to be added to label1 and everything that is labeled in tomo02_patch000_remove_0000 needs to be removed from label 1 (set to 0). The multilabel segmentation utilities should be the right place for this, but they do not work with multilabel images for some reason?

Here are the files:

In python:

label_1 = multilabel_seg == 1
label_1 = (label_1 | (add_seg == 1))  # bitwise OR
label_1[remove_seg == 1] = False  # XOR would work, too
multilabel_seg[multilabel_seg ==1] = 0  # remove label 1 from multilabel image (so that we can replace it)
multilabel_seg[label_1] = 1 # update label1 in multilabel image. remember that label_1 is a bool mask

Would be great to be able to just do it in MITK. If you have questions, please contact me :-)

Ubuntu 18.04

image.png (20×533 px, 6 KB)

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision

Event Timeline

kislinsk edited projects, added MITK (v2021.10); removed MITK.
kislinsk moved this task from Backlog to Segmentation on the MITK (v2021.10) board.

@isensee What exactly does not work?

  • Are you not able to load the data / ML nodes in the utilities selection widgets? That is a known bug and is addressed here: T28135
  • Are you not able to work with multiple labels at all? This is also a known problem, since the MultiLabel Utilities View was never correctly implemented for working with multiple labels.

Sorry but you probably have to wait - we are working heavily on the (ML) Segmentation redundancy and will probably come up with something more efficient, incorporating a new design for the MultiLabel Segmentations to flawlessly work with multiple labels.

However, I was able to presumably do what you wanted to do, see screenshots. This was a complex process and handcrafted solution but just to show if we are generally able to do what you want to do:
Before adding:

image.png (1×2 px, 277 KB)

After adding:

image.png (1×2 px, 269 KB)

Before removing:

image.png (1×2 px, 264 KB)

After removing:

image.png (1×2 px, 251 KB)

floca added a subscriber: floca.

@isensee Could you give some information regarding the question (see comment above) . Thanks.

Just had a talk with @kalali :

  • yes loading is a problem, I don't know whether that was also a problem back then. The multilabel segmentation utilities does not allow to select multilabel images
  • the main problem still persists: I cannot select a layer and a label that I want to modify with the plugin (this selection needs to be possible for all selected label images). In this particular case I wanted to add a small fraction of label_image_2_layer1_label1 to label_image_1_layer1_label1 using the 'union' tool

@kalali told me that adding this functionality seems to be already on your (Stefans?) todo list, so everything is great :-)
From my side there is absolutely no time pressure to solve this as we were able to run the required steps with a simple python script instead

kislinsk added a revision: Restricted Differential Revision.Oct 19 2022, 12:20 PM
kislinsk added a subscriber: kislinsk.