steps to reproduce:
- load pic3d.nrrd
- create segmentation with 3d-interpolator
- create new clipping plane
...
- repeat until it crashes
steps to reproduce:
...
Under windows the clipping plane plugin is always crashing when selecting an image in the datamanager and clicking the button "Create new clippping plane"
Crashes in QmitkDeformableClippingPlaneView.cpp
in line 381
//Add the plane to data storage this->GetDataStorage()->Add(planeNode);
The bug appears when the segmentation view is started but deactivated (in the background).
When the Plane-Node is added to the DataStorage,
//QmitkDeformableClippingPlaneView.cpp line 381
it will cause the ToolManager to change its working data (image)
//mitkToolManager.cpp line 329
Which emits a signal caught by the SlicesInterpolator
// QmitkSlicesInterpolator.cpp line 403
which will update the currently selected segmentation for the 3D interpolation
// QmitkSlicesInterpolator.cpp line 983
which will eventually crash when trying to access the dimension of the workingData from the tool manager, as it appears to be NULL
i fixed this issue by adding a check to the function
mitk::ToolManager::SetWorkingData(DataNode* data)
to see if the data parameter contains an image. For this i cast the data node to an mitk image, which might be not the most efficent way.
I created a branch containing the fix.
Sorry, if i understand yor fix right, it is not an option to have only images as working data for the clipping plane. E.g. You need a binary image to get a volume of the clipped parts. I have a look on the fix and for now i retract the release flag request.
This crash is due to the change that the Segmentation plugin now handle his ToolManager with a MicroService (Singleton). The clipping plane view is part of this plugin but handle seperatly. At the moment the clipping plane view gets his ToolManager from the Ui and now this is the same instance as for the Segmentation view. Problem: Working data changes at both Plugins and they can't handle that.
Fix: Get an own ToolManager
[a2166b]: Merge branch 'bug-16156-ClippingPlaneToolManager'
2013-09-27 13:45:56 Jasmin Metzger [dba44b]
Get an own instance of the ToolManager to avoid unwanted dependencies with the segmentation view.