Page MenuHomePhabricator

2D (multi-label) segmentation tools -> paint/wipe unusable for larger images
Closed, ResolvedPublic

Description

  • Load a large image (mine is 214x2048x2048)
  • Create a new segmentation and start drawing with the paint tool
  • Painting is excruciatingly slow with 2-3 updates per seconds resulting in horrendously blocky segmentations (mouse position is only captured 2-3 times per second and straight lines are drawn between those)

Ubuntu 20.04, 2021-10-18 snapshot

Event Timeline

(I was painting in axial slice which was 2048x2048)

kislinsk triaged this task as Normal priority.Oct 29 2021, 8:31 PM
floca added a subscriber: floca.

Reason for the sluggish behavior could be rooted in mitk::ContourModelUtils::FillSliceInSlice(...). This is triggered with every mouse move and is currently a single threaded vtk code (handcrafted for loop) that iterates over the whole image. Much becomes very costly for large images. :(
May be at least multi thread the code?

Thinking about this twice, the cleanest (but more expensive) approach would be to completly remove FillSliceInSlice instead use TransferLabelContent (LabelSetImage). Thus also the Function FillContourInSlice should be moved from ContourModel module to the Segmentation module.

@isensee could you provide such a large image?
P.S.: not needed any more. found one.

Test the switch to TransferLabelContent. It makes it faster, but not fast enough for a good UX. I think the only scalable way is to only process the boundingbox region of the image that (potentialy) altered instead of always the whole image.

Reworked the tools to make them faster.
Close ticket for now. If It is not fast enough we need to make more rework and need to make a in depth profiling where we loose the time.

@isensee Please let us know if it is still to slow. And reopen the task.