Page MenuHomePhabricator

[Segmentation] Changing groups on loaded multi-group segmentations crash
Closed, ResolvedPublic

Description

  • Load a segmentation that already has more than a single group
  • Click on a label in another group than "Group 0"

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision

Related Objects

Event Timeline

kislinsk triaged this task as Unbreak Now! priority.May 6 2023, 9:25 AM
kislinsk created this task.

It's not an IO error but again the interpolation.

The interpolation, even if deactivated, does bookkeeping for contours of drawn slices in a 3-dimensional list, where the first index is the current segmentation, the second index is the time, and the third index is the group/layer. There are a couple of situations where the list of contours are retrieved but one of the indices is out of range. This is currently just indicated by an MITK_ERROR message while the access is done anyway using .at() afterwards, which throws an exception that can be caught (spoiler: isn't caught in some situations). The list of contours is returned as reference.

To fix this, I will change the return type from a reference to a pointer, remove the error messages and return nullptr instead, and since the indices are checked anyway manually, access the 3-dimensional data structure using .operator[]. There are only two or three locations where the list of contours is retrieved that now need to check for a nullptr and can act accordingly instead of watching an exception fly by further up the stack.

While it fixes the crash, it breaks having contours for 3d-interpolation at all in other groups than Group 0. This can be easily fixed by checking for a nullptr contour list in one of the locations mentioned above, and initialize a contour list for the current group in that case if necessary.

I checked with 3-d and 4-d images with different amount of groups and it seems to work very well.

I can do it, if you want.

Thanks! Already fixed, I will create a Diff in a minute. :)

kislinsk added a revision: Restricted Differential Revision.May 6 2023, 9:49 AM