- Load a segmentation that already has more than a single group
- Click on a label in another group than "Group 0"
Description
Revisions and Commits
rMITK MITK | |||
Restricted Differential Revision | rMITK69c105b655f8 Fix crash when switching groups on loaded multi-group segmentations | ||
Restricted Differential Revision | rMITK3aeeb0fd7758 Fix crash when switching groups on loaded multi-group segmentations |
Related Objects
- Mentioned In
- T29605: 2023 Week 20 (Mid May)
Event Timeline
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.