Using a 4D image and a dynamic segmentation results in an exception thrown when using a “Custom” background value.
Tested with Pic2DplusT
Description
Description
Revisions and Commits
Revisions and Commits
rMITK MITK | |||
Restricted Differential Revision | rMITK0175a97810d0 fix image masking issues for images with multiple timesteps | ||
Restricted Differential Revision | rMITKb4acd382aa0d fix image masking issues for images with multiple timesteps |
Related Objects
Related Objects
- Mentioned In
- T28802: 2021 Week 45 (Early November)
Event Timeline
Comment Actions
Works with Zero and Minimum background value options, only "custom" results in an uncaught "dimension (4) is not in (2)(3)" exception + crash.
Also, dynamic image + static segmentation disables the image masking widgets with the message "Different image sizes cannot be masked". Tested with 2d+t and 3d+t image.
Comment Actions
I also looked into this task yesterday and the issue is that for custom background values, the "AccessByItk_n" function is used, which only works for 2D and 3D images. A potential fix would be to use the "AccessFixedDimensionByItk_n" function for the 4D case, then the Workbench does not crash anymore. So in the QmitkImageMaskingWidget.cpp one could replace
AccessByItk_n(referenceImage, GetRange, (bottom, top));
by
if (referenceImage->GetDimension() == 4) { AccessFixedDimensionByItk_n(referenceImage, GetRange, 4, (bottom, top)); } else { AccessByItk_n(referenceImage, GetRange, (bottom, top)); }
However, I'm not sure if this is the best solution