Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkRenderWindowUtilityWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkRenderWindowUtilityWidget_h
14 #define QmitkRenderWindowUtilityWidget_h
15 
16 #include "MitkQtWidgetsExports.h"
17 
18 // qt widgets module
21 #include <QmitkStepperAdapter.h>
24 
25 // qt
26 #include <QWidget>
27 #include <QHBoxLayout>
28 #include <QMenuBar>
29 #include <QComboBox>
30 
31 namespace mitk
32 {
33  class DataStorage;
34 }
35 
36 class QmitkRenderWindow;
37 
38 /*
39 * @brief The 'QmitkRenderWindowUtilityWidget' can be added to a 'QMitkRenderWindowWidget' to extend it
40 * with window-specific utilities.
41 *
42 * It offers to select the viewing direction of the window, as well as a 'QmitkSliceNavigationWidget'
43 * to scroll through the current view direction.
44 * In addition, it contains a 'QmitkSynchronizedNodeSelectionWidget' that controls renderer-specific
45 * properties and shown nodes, as well as a synchronization-group selector to share this state with
46 * other render windows.
47 */
49 {
50  Q_OBJECT
51 
52 public:
53 
55  QWidget* parent = nullptr,
56  QmitkRenderWindow* renderWindow = nullptr,
57  mitk::DataStorage* dataStorage = nullptr,
58  const int nSyncGroups = 1
59  );
60 
62 
63  using GroupSyncIndexType = int;
64 
65  void SetSyncGroup(const GroupSyncIndexType index);
67  void OnSyncGroupSelectionChanged(int index);
68 
69  void SetGeometry(const itk::EventObject& event);
71 
72 public Q_SLOTS:
75 
76 Q_SIGNALS:
77 
80  void SetDataSelection(const QList<mitk::DataNode::Pointer>& newSelection);
81 
82 private:
83 
84  mitk::BaseRenderer* m_BaseRenderer;
85  QmitkSynchronizedNodeSelectionWidget* m_NodeSelectionWidget;
86  QPushButton* m_SynchPushButton;
87  QComboBox* m_SyncGroupSelector;
88  QmitkSliceNavigationWidget* m_SliceNavigationWidget;
89  QmitkStepperAdapter* m_StepperAdapter;
90  std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
91  std::unique_ptr<mitk::RenderWindowViewDirectionController> m_RenderWindowViewDirectionController;
92  QComboBox* m_ViewDirectionSelector;
93 
94  void ChangeViewDirection(const QString& viewDirection);
95 
96 };
97 
98 #endif
#define MITKQTWIDGETS_EXPORT
void SyncGroupChanged(QmitkSynchronizedNodeSelectionWidget *synchronizedWidget, GroupSyncIndexType index)
GroupSyncIndexType GetSyncGroup() const
void SetSyncGroup(const GroupSyncIndexType index)
void OnSyncGroupSelectionChanged(int index)
void OnSyncGroupAdded(const GroupSyncIndexType index)
void SynchronizationToggled(QmitkSynchronizedNodeSelectionWidget *synchronizedWidget)
~QmitkRenderWindowUtilityWidget() override
QmitkRenderWindowUtilityWidget(QWidget *parent=nullptr, QmitkRenderWindow *renderWindow=nullptr, mitk::DataStorage *dataStorage=nullptr, const int nSyncGroups=1)
QmitkSynchronizedNodeSelectionWidget * GetNodeSelectionWidget() const
void SetDataSelection(const QList< mitk::DataNode::Pointer > &newSelection)
void SetGeometry(const itk::EventObject &event)
MITK implementation of the QVTKWidget.
Helper class to connect Qt-based navigators to instances of Stepper.
Data management class that handles 'was created by' relations.
Find image slices visible on a given plane.