Page MenuHomePhabricator

RenderWindowPartActivated is not called in several plugins
Open, NormalPublic


When using a plugin that implements IRenderWindowPartListener (e.g. in QmitkSegmentationView, QmitkPropertyTreeView), the overridden function RenderWindowPartActivated is not called. This is due to the fact that the Display with the StdMultiWidgetEditor (the current render window part) was visible and activated before. So no signal is emitted, when the plugin is opened. However, the signal is emitted when the display is hidden and then shown again, e.g. by opening and closing the DICOM Browser.

Therefore the m_SlicesInterpolator of the segmentation-plugin is not initialized with the tool manager. Using an invalid tool manager leads to a crash when trying to interpolate between segmentation slices.

I propose to look into the different implementations of the plugins and check, if the code is initialization code that can be moved to the constructor or to the Activated/Deactivated-functions (which may be called also during plugin lifetime). If the code is RenderWindowPart-dependent code, like getting the render windows, we have to think of another solution.

Event Timeline

One solution that is also used in some plugins is, to use

if (mitk::IRenderWindowPart *renderWindowPart = GetRenderWindowPart())

in the constructor or in the CreateQtPartControl-function, in order to check for a valid render window part during plugin initialization.

kalali added a project: Restricted Project.

Pushed new branch T23274-Segmentation-plugin-call-to-RenderWindowPartActivated.

This solves the problem for the classic segmentation plugin. Other plugins may need such a specific call, too.

kalali lowered the priority of this task from High to Normal.Sep 29 2017, 9:52 AM
kalali removed a project: Restricted Project.
kalali added a project: Restricted Project.

Currently not merged - other plugins may need such a specific call, too

kislinsk added a project: Auto-closed.

Hi there! 🙂

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. 🚑

Best wishes,
The MITK devs

kalali removed projects: Auto-closed, Restricted Project.

Generally this is still valid as it was only done in one plugin to show the idea behind it. We need to check if this is still a problem.