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
36
class
MITKQTWIDGETS_EXPORT
QmitkLevelWindowWidgetContextMenu
:
public
QWidget
37
{
38
Q_OBJECT
39
40
public
:
46
QmitkLevelWindowWidgetContextMenu
(QWidget *parent, Qt::WindowFlags f = {});
47
~QmitkLevelWindowWidgetContextMenu
()
override
;
48
50
mitk::LevelWindowPreset
*
m_LevelWindowPreset
;
51
53
mitk::LevelWindow
m_LevelWindow
;
54
56
QMenu *
m_PresetSubmenu
;
57
59
QMenu *
m_ImageSubmenu
;
60
62
mitk::LevelWindowManager
*
m_Manager
;
63
65
std::map<QAction *, mitk::LevelWindowProperty::Pointer>
m_Images
;
66
71
void
GetContextMenu
(QMenu *contextMenu);
72
76
void
GetContextMenu
();
77
82
void
SetLevelWindowManager
(
mitk::LevelWindowManager
*levelWindowManager);
83
84
protected
:
85
86
QAction *
m_PresetAction
;
87
QAction *
m_AutoTopmostAction
;
88
QAction *
m_SelectedImagesAction
;
89
90
protected
Q_SLOTS:
91
93
void
OnSetPreset
(
const
QAction *presetAction);
94
97
void
OnUseOptimizedLevelWindow
();
98
100
void
OnUseAllGreyvaluesFromImage
();
101
103
void
OnSetFixed
();
104
106
void
OnAddPreset
();
107
109
void
OnSetDefaultLevelWindow
();
110
112
void
OnSetDefaultScaleRange
();
113
115
void
OnChangeScaleRange
();
116
118
void
OnSetImage
(QAction *imageAction);
119
121
void
OnSetMaximumWindow
();
122
};
123
124
#endif
MitkQtWidgetsExports.h
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition:
MitkQtWidgetsExports.h:15
QmitkLevelWindowWidgetContextMenu
Provides a context menu for level/window manipulation.
Definition:
QmitkLevelWindowWidgetContextMenu.h:37
QmitkLevelWindowWidgetContextMenu::OnUseOptimizedLevelWindow
void OnUseOptimizedLevelWindow()
QmitkLevelWindowWidgetContextMenu::OnUseAllGreyvaluesFromImage
void OnUseAllGreyvaluesFromImage()
calls the mitkLevelWindow SetToImageRange method, so that the greyvalues from whole image will be use...
QmitkLevelWindowWidgetContextMenu::OnSetDefaultLevelWindow
void OnSetDefaultLevelWindow()
resets the current images Level/Window to its default values
QmitkLevelWindowWidgetContextMenu::m_ImageSubmenu
QMenu * m_ImageSubmenu
Submenu listing all available images.
Definition:
QmitkLevelWindowWidgetContextMenu.h:59
QmitkLevelWindowWidgetContextMenu::OnSetImage
void OnSetImage(QAction *imageAction)
sets the selected image or the topmost layer image to the new current image
QmitkLevelWindowWidgetContextMenu::OnSetFixed
void OnSetFixed()
sets the level window slider to be fixed
QmitkLevelWindowWidgetContextMenu::OnChangeScaleRange
void OnChangeScaleRange()
changes the current images scalerange
QmitkLevelWindowWidgetContextMenu::m_SelectedImagesAction
QAction * m_SelectedImagesAction
Definition:
QmitkLevelWindowWidgetContextMenu.h:88
QmitkLevelWindowWidgetContextMenu::m_PresetSubmenu
QMenu * m_PresetSubmenu
Submenu listing all available presets.
Definition:
QmitkLevelWindowWidgetContextMenu.h:56
QmitkLevelWindowWidgetContextMenu::OnAddPreset
void OnAddPreset()
adds a new Preset for presets-contextmenu
QmitkLevelWindowWidgetContextMenu::QmitkLevelWindowWidgetContextMenu
QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f={})
Constructs the context menu widget.
QmitkLevelWindowWidgetContextMenu::m_Manager
mitk::LevelWindowManager * m_Manager
The LevelWindowManager that tracks level/window changes and holds the current image's LevelWindowProp...
Definition:
QmitkLevelWindowWidgetContextMenu.h:62
QmitkLevelWindowWidgetContextMenu::m_LevelWindow
mitk::LevelWindow m_LevelWindow
Stores the current level/window values manipulated by the context menu.
Definition:
QmitkLevelWindowWidgetContextMenu.h:53
QmitkLevelWindowWidgetContextMenu::m_PresetAction
QAction * m_PresetAction
Definition:
QmitkLevelWindowWidgetContextMenu.h:86
QmitkLevelWindowWidgetContextMenu::m_Images
std::map< QAction *, mitk::LevelWindowProperty::Pointer > m_Images
Maps context menu actions to their associated LevelWindowProperty for image selection.
Definition:
QmitkLevelWindowWidgetContextMenu.h:65
QmitkLevelWindowWidgetContextMenu::GetContextMenu
void GetContextMenu()
Creates and shows a standalone context menu with standard level/window actions.
QmitkLevelWindowWidgetContextMenu::m_LevelWindowPreset
mitk::LevelWindowPreset * m_LevelWindowPreset
Handles reading and writing of level/window presets from an XML file.
Definition:
QmitkLevelWindowWidgetContextMenu.h:50
QmitkLevelWindowWidgetContextMenu::OnSetMaximumWindow
void OnSetMaximumWindow()
sets the window to its maximum Size to fit the scalerange
QmitkLevelWindowWidgetContextMenu::m_AutoTopmostAction
QAction * m_AutoTopmostAction
Definition:
QmitkLevelWindowWidgetContextMenu.h:87
QmitkLevelWindowWidgetContextMenu::OnSetPreset
void OnSetPreset(const QAction *presetAction)
sets level and window value of the current image to the values defined for the selected preset
QmitkLevelWindowWidgetContextMenu::OnSetDefaultScaleRange
void OnSetDefaultScaleRange()
resets the current images scalerange to its default values
QmitkLevelWindowWidgetContextMenu::~QmitkLevelWindowWidgetContextMenu
~QmitkLevelWindowWidgetContextMenu() override
QmitkLevelWindowWidgetContextMenu::SetLevelWindowManager
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager)
Sets the LevelWindowManager used for image queries and change notifications.
QmitkLevelWindowWidgetContextMenu::GetContextMenu
void GetContextMenu(QMenu *contextMenu)
Appends standard level/window actions to an existing context menu.
mitk::LevelWindowManager
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
Definition:
mitkLevelWindowManager.h:52
mitk::LevelWindowPreset
Manages level/window presets loaded from an XML file.
Definition:
mitkLevelWindowPreset.h:30
mitk::LevelWindow
The LevelWindow class Class to store level/window values.
Definition:
mitkLevelWindow.h:44
mitkLevelWindowManager.h
mitkLevelWindowPreset.h
src
MITK
Modules
QtWidgets
include
QmitkLevelWindowWidgetContextMenu.h
Generated by
1.9.1