MITK Tutorial - Step 8: Use QmitkStdMultiWidget as widget

In this step a QmitkStdMultiWidget is used. It offers four views on the data. From top left to bottom the views are initialized as transversal, sagittal and coronar. The bottom right view is initialized as 3D view.

step8_result.png

Step8 inherits from Step6. The method SetupWidgets() is changed: A QmitkStdMultiWidget is used instead of one QmitkRenderWindow and two instances of QmitkSliceWidget.

        // Part Ia: create and initialize QmitkStdMultiWidget
        //*************************************************************************
        QmitkStdMultiWidget* multiWidget = new QmitkStdMultiWidget(viewParent);

        hlayout->addWidget(multiWidget);

        // Tell the multiWidget which DataStorage to render
        multiWidget->SetDataStorage(m_DataStorage);

        // Initialize views as transversal, sagittal, coronar (from
        // top-left to bottom)
        mitk::TimeSlicedGeometry::Pointer geo = m_DataStorage->ComputeBoundingGeometry3D(
                        m_DataStorage->GetAll());
        mitk::RenderingManager::GetInstance()->InitializeViews(geo);

        // Initialize bottom-right view as 3D view
        multiWidget->GetRenderWindow4()->GetRenderer()->SetMapperID(
                        mitk::BaseRenderer::Standard3D);

        // Enable standard handler for levelwindow-slider
        multiWidget->EnableStandardLevelWindow();

        // Add the displayed views to the DataStorage to see their positions in 2D and 3D
        multiWidget->AddDisplayPlaneSubTree();
        multiWidget->AddPlanesToDataStorage();
        multiWidget->SetWidgetPlanesVisibility(true);

        //*************************************************************************
        // Part II: Setup standard interaction with the mouse
        //*************************************************************************

        // Moving the cut-planes to click-point
        multiWidget->EnableNavigationControllerEventListening();

        // Zooming and panning
        mitk::GlobalInteraction::GetInstance()->AddListener(
                        multiWidget->GetMoveAndZoomInteractor());

[Previous step] [Next step]

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines