Medical Imaging Interaction Toolkit  2025.12.02
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 
50  QWidget* parent = nullptr,
51  const QString& widgetName = "",
52  mitk::DataStorage* dataStorage = nullptr);
53 
55 
56  void SetDataStorage(mitk::DataStorage* dataStorage);
57 
58  const QString& GetWidgetName() const { return m_WidgetName; };
59  QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; };
60 
62 
63  void RequestUpdate();
65 
66  void AddUtilityWidget(QWidget* utilityWidget);
68 
69  void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
70  void ShowGradientBackground(bool enable);
71  std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors() const { return m_GradientBackgroundColors; };
72  bool IsGradientBackgroundOn() const;
73 
74  void SetDecorationColor(const mitk::Color& color);
75  mitk::Color GetDecorationColor() const { return m_DecorationColor; };
76 
77  void ShowColoredRectangle(bool show);
79 
80  void ShowCornerAnnotation(bool show);
82  void SetCornerAnnotationText(const std::string& cornerAnnotation);
83  std::string GetCornerAnnotationText() const;
84 
86 
87  void SetCrosshairVisibility(bool visible);
89  void SetCrosshairGap(unsigned int gapSize);
90 
93 
94  void SetCrosshairPosition(const mitk::Point3D& newPosition);
96 
97  void SetGeometry(const itk::EventObject& event);
98  void SetGeometrySlice(const itk::EventObject& event);
99 
100 public Q_SLOTS:
101 
103 
104 private:
105 
106  void InitializeGUI();
107  void InitializeDecorations();
108  void ResetGeometry(const mitk::TimeGeometry* referenceGeometry);
109 
110  QString m_WidgetName;
111  QVBoxLayout* m_Layout;
112 
113  mitk::DataStorage* m_DataStorage;
114 
115  QmitkRenderWindow* m_RenderWindow;
116 
117  mitk::CrosshairManager::Pointer m_CrosshairManager;
118 
119  std::pair<mitk::Color, mitk::Color> m_GradientBackgroundColors;
120  mitk::Color m_DecorationColor;
121  vtkSmartPointer<vtkCornerAnnotation> m_CornerAnnotation;
122 
123 };
124 
125 #endif
#define MITKQTWIDGETS_EXPORT
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
void ShowColoredRectangle(bool show)
void SetGeometry(const itk::EventObject &event)
const QString & GetWidgetName() const
mitk::SliceNavigationController * GetSliceNavigationController() const
~QmitkRenderWindowWidget() override
void ShowGradientBackground(bool enable)
bool IsRenderWindowMenuActivated() const
QmitkRenderWindowWidget(QWidget *parent=nullptr, const QString &widgetName="", mitk::DataStorage *dataStorage=nullptr)
void SetCrosshairGap(unsigned int gapSize)
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.
Data management class that handles 'was created by' relations.
Controls the selection of the slice the associated BaseRenderer will display.
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)