Page MenuHomePhabricator | MITK

RenderWindowPartActivated is not called in several plugins
Open, NormalPublic

Description

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

kalali created this task.Aug 18 2017, 11:35 AM

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

if (mitk::IRenderWindowPart *renderWindowPart = GetRenderWindowPart())
{
  RenderWindowPartActivated(renderWindowPart);
}

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

kalali claimed this task.Aug 18 2017, 12:31 PM
kalali added a project: Restricted Project.
kalali added a comment.EditedAug 18 2017, 2:09 PM

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.Oct 17 2018, 2:27 PM
kalali removed kalali as the assignee of this task.

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