Medical Imaging Interaction Toolkit  2026.06.00
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:
87  QmitkSliderLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
88 
90 
96 
102 
108 
111 
113  mitk::LevelWindowManager::Pointer m_Manager;
114 
115 private:
117  void contextMenuEvent(QContextMenuEvent *) override;
118 
120  void OnPropertyModified(const itk::EventObject &e);
121 
122 protected:
124  virtual void Update();
125 
129  QRect m_Rect;
130 
134  QPoint m_StartPos;
135 
136  bool m_Resize;
137  bool m_Bottom;
145  unsigned long m_ObserverTag;
147 
148  QFont m_Font;
149 
154 
158  void paintEvent(QPaintEvent *e) override;
159 
167  void mouseMoveEvent(QMouseEvent *mouseEvent) override;
168 
169  void enterEvent(QEnterEvent *event) override;
170 
178  void mousePressEvent(QMouseEvent *mouseEvent) override;
179 
183  void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
184 
188  void resizeEvent(QResizeEvent *event) override;
189 
190 protected Q_SLOTS:
191 
194  void HideScale();
195 
198  void ShowScale();
199 };
200 
201 #endif
#define MITKQTWIDGETS_EXPORT
Provides a context menu for level/window manipulation.
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
The LevelWindowManager responsible for collecting and delivering level/window changes.
QmitkLevelWindowWidgetContextMenu * m_Contextmenu
void SetDataStorage(mitk::DataStorage *ds)
Sets the DataStorage that 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 LevelWindowManager for this widget.
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={})
Constructs the slider level/window widget.
mitk::LevelWindowManager * GetManager()
Returns the LevelWindowManager used by this widget.
mitk::LevelWindow m_LevelWindow
Stores the current level/window values.
void mousePressEvent(QMouseEvent *mouseEvent) override
~QmitkSliderLevelWindowWidget() override
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
The LevelWindow class Class to store level/window values.