Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkRenderWindowWidget.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 QmitkRenderWindowWidget_h
14 #define QmitkRenderWindowWidget_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 // qt widgets module
19 #include <QmitkRenderWindow.h>
20 
21 // mitk core
22 #include <mitkCrosshairManager.h>
23 #include <mitkDataStorage.h>
24 #include <mitkRenderWindow.h>
26 
27 // qt
28 #include <QFrame>
29 #include <QMouseEvent>
30 #include <QVBoxLayout>
31 
32 class vtkCornerAnnotation;
33 
44 {
45  Q_OBJECT
46 
47 public:
48 
65  QWidget* parent,
66  const QString& widgetName,
67  mitk::DataStorage* dataStorage);
68 
70 
71  void SetDataStorage(mitk::DataStorage* dataStorage);
72 
73  const QString& GetWidgetName() const { return m_WidgetName; };
74  QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; };
75 
85  const QString& GetDisplayName() const { return m_DisplayName; };
86  void SetDisplayName(const QString& displayName) { m_DisplayName = displayName; };
87 
89 
90  void RequestUpdate();
92 
93  void AddUtilityWidget(QWidget* utilityWidget);
96 
97  void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
98  void ShowGradientBackground(bool enable);
99  std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors() const { return m_GradientBackgroundColors; };
101 
102  void SetDecorationColor(const mitk::Color& color);
103  mitk::Color GetDecorationColor() const { return m_DecorationColor; };
104 
105  void ShowColoredRectangle(bool show);
107 
108  void ShowCornerAnnotation(bool show);
110  void SetCornerAnnotationText(const std::string& cornerAnnotation);
111  std::string GetCornerAnnotationText() const;
112 
114 
115  void SetCrosshairVisibility(bool visible);
117  void SetCrosshairGap(unsigned int gapSize);
118 
121 
122  void SetCrosshairPosition(const mitk::Point3D& newPosition);
124 
125  void SetGeometry(const itk::EventObject& event);
126  void SetGeometrySlice(const itk::EventObject& event);
127 
128 public Q_SLOTS:
129 
131 
132 private:
133 
134  void InitializeGUI();
135  void InitializeDecorations();
136  void ResetGeometry(const mitk::TimeGeometry* referenceGeometry);
137 
138  QString m_WidgetName;
139  QString m_DisplayName;
140  QVBoxLayout* m_Layout;
141 
142  mitk::DataStorage* m_DataStorage;
143 
144  QmitkRenderWindow* m_RenderWindow;
145 
146  mitk::CrosshairManager::Pointer m_CrosshairManager;
147 
148  std::pair<mitk::Color, mitk::Color> m_GradientBackgroundColors;
149  mitk::Color m_DecorationColor;
150  vtkSmartPointer<vtkCornerAnnotation> m_CornerAnnotation;
151 
152 };
153 
154 #endif
#define MITKQTWIDGETS_EXPORT
Utility widget that extends a QmitkRenderWindowWidget with window-specific controls.
The 'QmitkRenderWindowWidget' is a QFrame that holds a render window and some associates properties,...
QmitkRenderWindowUtilityWidget * GetUtilityWidget()
bool IsCornerAnnotationVisible() const
void SetCornerAnnotationText(const std::string &cornerAnnotation)
bool IsColoredRectangleVisible() const
std::pair< mitk::Color, mitk::Color > GetGradientBackgroundColors() const
const QmitkRenderWindowUtilityWidget * GetUtilityWidget() const
void ShowColoredRectangle(bool show)
void SetGeometry(const itk::EventObject &event)
const QString & GetWidgetName() const
mitk::SliceNavigationController * GetSliceNavigationController() const
QmitkRenderWindowWidget(QWidget *parent, const QString &widgetName, mitk::DataStorage *dataStorage)
Construct a render-window widget.
~QmitkRenderWindowWidget() override
void ShowGradientBackground(bool enable)
bool IsRenderWindowMenuActivated() const
void SetCrosshairGap(unsigned int gapSize)
const QString & GetDisplayName() const
Optional human-readable display label.
void SetDisplayName(const QString &displayName)
void SetCrosshairPosition(const mitk::Point3D &newPosition)
void SetDataStorage(mitk::DataStorage *dataStorage)
void SetCrosshairVisibility(bool visible)
void AddUtilityWidget(QWidget *utilityWidget)
void SetDecorationColor(const mitk::Color &color)
std::string GetCornerAnnotationText() const
void SetGradientBackgroundColors(const mitk::Color &upper, const mitk::Color &lower)
QmitkRenderWindow * GetRenderWindow() const
bool IsGradientBackgroundOn() const
void ShowCornerAnnotation(bool show)
mitk::Point3D GetCrosshairPosition() const
void SetGeometrySlice(const itk::EventObject &event)
mitk::Color GetDecorationColor() const
MITK implementation of the QVTKWidget.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Controls the selection of the slice the associated BaseRenderer will display.
itk::RGBPixel< float > Color
Standard RGB color typedef using float components.