We have a segmentation plugin that uses the MITK tool framework, but provides different tool and tool gui classes. I noticed that even if the MITK segmentation plugin is not turned on, the MITK segmentation tools, e.g. LiveWireTool2D are active. For instance, when I close the application it requests an update on all the render windows.
The source of the problem is the mitk::ToolManager::InitializeTools() function that creates an instance of every tool whose class is registered in the object factory.
I created a patch that defines a RegisterTool and UnregisterTool function in mitk::ToolManager and makes the InitializeTools function deprecated. With the patch the current tools should be registered from somewhere else, e.g. the the plugin activator of the segmentation plugin or the tool selection box.
This does not affect the MITK_TOOL_MACRO. The factories are created for the tools in the same way, and the tool managers create the tools using these factories, just not for all of them automatically but only for those that are registered by hand.