Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkLevelWindowWidgetContextMenu.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 QmitkLevelWindowWidgetContextMenu_h
14 #define QmitkLevelWindowWidgetContextMenu_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <QMenu>
19 #include <mitkLevelWindowManager.h>
20 #include <mitkLevelWindowPreset.h>
21 
31 {
32  Q_OBJECT
33 
34 public:
36  QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f = {});
38 
43 
49 
52 
55 
59 
62  std::map<QAction *, mitk::LevelWindowProperty::Pointer> m_Images;
63 
69  void GetContextMenu(QMenu *contextMenu);
70 
73 
76 
77 protected:
78 
79  QAction *m_PresetAction;
82 
83 protected Q_SLOTS:
84 
86  void OnSetPreset(const QAction *presetAction);
87 
91 
94 
96  void OnSetFixed();
97 
99  void OnAddPreset();
100 
103 
106 
109 
111  void OnSetImage(QAction *imageAction);
112 
115 };
116 
117 #endif
#define MITKQTWIDGETS_EXPORT
Provides a contextmenu for Level/Window functionality.
void OnUseAllGreyvaluesFromImage()
calls the mitkLevelWindow SetToImageRange method, so that the greyvalues from whole image will be use...
void OnSetDefaultLevelWindow()
resets the current images Level/Window to its default values
QMenu * m_ImageSubmenu
submenu with all images for contextmenu
void OnSetImage(QAction *imageAction)
sets the selected image or the topmost layer image to the new current image
void OnSetFixed()
sets the level window slider to be fixed
void OnChangeScaleRange()
changes the current images scalerange
QMenu * m_PresetSubmenu
submenu with all presets for contextmenu
void OnAddPreset()
adds a new Preset for presets-contextmenu
QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f={})
constructor
std::map< QAction *, mitk::LevelWindowProperty::Pointer > m_Images
void GetContextMenu()
returns the contextmenu with standard functions for Level/Window
void OnSetMaximumWindow()
sets the window to its maximum Size to fit the scalerange
void OnSetPreset(const QAction *presetAction)
sets level and window value of the current image to the values defined for the selected preset
void OnSetDefaultScaleRange()
resets the current images scalerange to its default values
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager)
lets this object know about the LevelWindowManager to get all images and tell about changes
void GetContextMenu(QMenu *contextMenu)
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
The LevelWindow class Class to store level/window values.