Page MenuHomePhabricator

[mxn multi widget] Render windows are not correctly initialized
Open, NormalPublic

Description

When a new render window (widget) is added to the MxNMultiWidget, e.g. by extending the layout, the newly created render windows do not initialize the render window correctly. This results in a render window showing images from the data storage, but zoomed in.

To reproduce:

  1. open MITK, load an image
  2. close the Standard Display, open the MxNDisplay
  3. see how even the first render window does not display the whole image
  4. use the layout icon in the configuration toolbar on the right side to add more render windows
  5. see how the newly added render windows do not display the whole image
  6. change the view direction of a render window
    • see how the render window is initialized correctly
  7. perform a reinit / global reinit using the context menu of the node in the data storage
    • see how all render windows are initialized correctly.

Interestingly:

  • the zoom-level differs, depending on the size of the multi widget
    • you can test this by opening another plugin or letting the MxN Display cover the whole workbench area
  • this also happens with the Standard Display, but only if the Standard Display is opened and an image was already loaded
    • this can be tested by
      1. open MITK, load an image
      2. close the Standard Display
      3. open the Standard Display again
        • see how only the first render window is initialized correctly
        • this again might depend on the size of the widget

Event Timeline

kalali triaged this task as Normal priority.Apr 4 2023, 10:04 AM
kalali created this task.

It seems as if setting a new layout leads to a RenderingManager::ForceImmediateUpdate, which repaints the render windows.
This is triggered by renderWindowWidget->show() inside the QmitkMultiWidgetLayoutManager, which happens everytime the Standard Display is opened or the layout of the MxNMultiWidget is modified.
This in turn calls QmitkRenderWindow::resizeGL, where mitk::RenderingManager::GetInstance()->ForceImmediateUpdate(renderWindow()); is called.