Medical Imaging Interaction Toolkit  2026.06.00
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 
37 {
38  Q_OBJECT
39 
40 public:
46  QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f = {});
48 
51 
54 
57 
60 
63 
65  std::map<QAction *, mitk::LevelWindowProperty::Pointer> m_Images;
66 
71  void GetContextMenu(QMenu *contextMenu);
72 
77 
83 
84 protected:
85 
86  QAction *m_PresetAction;
89 
90 protected Q_SLOTS:
91 
93  void OnSetPreset(const QAction *presetAction);
94 
98 
101 
103  void OnSetFixed();
104 
106  void OnAddPreset();
107 
110 
113 
116 
118  void OnSetImage(QAction *imageAction);
119 
122 };
123 
124 #endif
#define MITKQTWIDGETS_EXPORT
Provides a context menu for level/window manipulation.
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 listing all available images.
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 listing all available presets.
void OnAddPreset()
adds a new Preset for presets-contextmenu
QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f={})
Constructs the context menu widget.
mitk::LevelWindowManager * m_Manager
The LevelWindowManager that tracks level/window changes and holds the current image's LevelWindowProp...
mitk::LevelWindow m_LevelWindow
Stores the current level/window values manipulated by the context menu.
std::map< QAction *, mitk::LevelWindowProperty::Pointer > m_Images
Maps context menu actions to their associated LevelWindowProperty for image selection.
void GetContextMenu()
Creates and shows a standalone context menu with standard level/window actions.
mitk::LevelWindowPreset * m_LevelWindowPreset
Handles reading and writing of level/window presets from an XML file.
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)
Sets the LevelWindowManager used for image queries and change notifications.
void GetContextMenu(QMenu *contextMenu)
Appends standard level/window actions to an existing context menu.
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
Manages level/window presets loaded from an XML file.
The LevelWindow class Class to store level/window values.