Due to inconsistent implementation of the interaction concept in all of the segmentation tools there may arise situation where the segmentation tools cause MITK to crash.
The reason is that the CanHandleEvent function is used in order to determine whether an interaction event is suitable for the tool or not. However this check is done within the methods that implement the actions of the respective statemachine pattern of the tools, i.e. the state transition is already done at this point.
In case of the LiveWire to the check is done right at the beginning of OnInitLiveWire, which then returns due to a 3D interaction event which cannot be handled. However the transition was done and another action is executed. The crash happens then due to uninitialized LiveWireTool members.
Solution: Implement the FilterEvents function which is called before the state transition.
Remove all the CanHandleEvent calls.
Furthermore a lot dynamic_casts from InteractionEvent to InteractionPositionEvent can be removed.