Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkSliderLevelWindowWidget.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 QmitkSliderLevelWindowWidget_h
14 #define QmitkSliderLevelWindowWidget_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <QWidget>
19 #include <mitkLevelWindowManager.h>
20 
22 
78 {
79  Q_OBJECT
80 
81 public:
83  QmitkSliderLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
84 
87 
90 
93 
96 
98 
100  mitk::LevelWindowManager::Pointer m_Manager;
101 
102 private:
104  void contextMenuEvent(QContextMenuEvent *) override;
105 
107  void OnPropertyModified(const itk::EventObject &e);
108 
109 protected:
111  virtual void Update();
112 
116  QRect m_Rect;
117 
121  QPoint m_StartPos;
122 
123  bool m_Resize;
124  bool m_Bottom;
132  unsigned long m_ObserverTag;
134 
135  QFont m_Font;
136 
141 
145  void paintEvent(QPaintEvent *e) override;
146 
154  void mouseMoveEvent(QMouseEvent *mouseEvent) override;
155 
156  void enterEvent(QEnterEvent *event) override;
157 
165  void mousePressEvent(QMouseEvent *mouseEvent) override;
166 
170  void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
171 
175  void resizeEvent(QResizeEvent *event) override;
176 
177 protected Q_SLOTS:
178 
181  void HideScale();
182 
185  void ShowScale();
186 };
187 
188 #endif
#define MITKQTWIDGETS_EXPORT
Provides a contextmenu for Level/Window functionality.
Provides a widget with a slider to change the level and window value of the current image.
void mouseReleaseEvent(QMouseEvent *mouseEvent) override
void enterEvent(QEnterEvent *event) override
void resizeEvent(QResizeEvent *event) override
mitk::LevelWindowManager::Pointer m_Manager
manager who is responsible to collect and deliver changes on Level/Window
QmitkLevelWindowWidgetContextMenu * m_Contextmenu
void SetDataStorage(mitk::DataStorage *ds)
sets the DataStorage which holds all image-nodes
void HideScale()
Hide the scale if "Hide Scale" is selected in the context menu.
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager)
sets the manager who is responsible to collect and deliver changes on Level/Window
void ShowScale()
Shows the scale if "Show Scale" is selected in the context menu.
void mouseMoveEvent(QMouseEvent *mouseEvent) override
virtual void Update()
recalculate the size and position of the slider bar
void paintEvent(QPaintEvent *e) override
QmitkSliderLevelWindowWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
constructor
mitk::LevelWindowManager * GetManager()
returns the manager who is responsible to collect and deliver changes on Level/Window
void mousePressEvent(QMouseEvent *mouseEvent) override
~QmitkSliderLevelWindowWidget() override
destructor
Data management class that handles 'was created by' relations.
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
The LevelWindow class Class to store level/window values.