Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkLevelWindowWidgetContextMenu Class Reference

Provides a context menu for level/window manipulation. More...

#include <QmitkLevelWindowWidgetContextMenu.h>

Inheritance diagram for QmitkLevelWindowWidgetContextMenu:
Collaboration diagram for QmitkLevelWindowWidgetContextMenu:

Public Member Functions

 QmitkLevelWindowWidgetContextMenu (QWidget *parent, Qt::WindowFlags f={})
 Constructs the context menu widget. More...
 
 ~QmitkLevelWindowWidgetContextMenu () override
 
void GetContextMenu (QMenu *contextMenu)
 Appends standard level/window actions to an existing context menu. More...
 
void GetContextMenu ()
 Creates and shows a standalone context menu with standard level/window actions. More...
 
void SetLevelWindowManager (mitk::LevelWindowManager *levelWindowManager)
 Sets the LevelWindowManager used for image queries and change notifications. More...
 

Public Attributes

mitk::LevelWindowPreset * m_LevelWindowPreset
 Handles reading and writing of level/window presets from an XML file. More...
 
mitk::LevelWindow m_LevelWindow
 Stores the current level/window values manipulated by the context menu. More...
 
QMenu * m_PresetSubmenu
 Submenu listing all available presets. More...
 
QMenu * m_ImageSubmenu
 Submenu listing all available images. More...
 
mitk::LevelWindowManager * m_Manager
 The LevelWindowManager that tracks level/window changes and holds the current image's LevelWindowProperty. More...
 
std::map< QAction *, mitk::LevelWindowProperty::Pointer > m_Images
 Maps context menu actions to their associated LevelWindowProperty for image selection. More...
 

Protected Slots

void OnSetPreset (const QAction *presetAction)
 sets level and window value of the current image to the values defined for the selected preset More...
 
void OnUseOptimizedLevelWindow ()
 
void OnUseAllGreyvaluesFromImage ()
 calls the mitkLevelWindow SetToImageRange method, so that the greyvalues from whole image will be used More...
 
void OnSetFixed ()
 sets the level window slider to be fixed More...
 
void OnAddPreset ()
 adds a new Preset for presets-contextmenu More...
 
void OnSetDefaultLevelWindow ()
 resets the current images Level/Window to its default values More...
 
void OnSetDefaultScaleRange ()
 resets the current images scalerange to its default values More...
 
void OnChangeScaleRange ()
 changes the current images scalerange More...
 
void OnSetImage (QAction *imageAction)
 sets the selected image or the topmost layer image to the new current image More...
 
void OnSetMaximumWindow ()
 sets the window to its maximum Size to fit the scalerange More...
 

Protected Attributes

QAction * m_PresetAction
 
QAction * m_AutoTopmostAction
 
QAction * m_SelectedImagesAction
 

Detailed Description

Provides a context menu for level/window manipulation.

This widget creates a context menu offering standard level/window operations such as preset selection, auto-optimization, scale range changes, and image selection. It can either generate a standalone context menu or append its entries to an existing QMenu.

See also
QmitkSliderLevelWindowWidget
QmitkLineEditLevelWindowWidget
QmitkLevelWindowWidget
mitk::LevelWindowManager

Definition at line 36 of file QmitkLevelWindowWidgetContextMenu.h.

Constructor & Destructor Documentation

◆ QmitkLevelWindowWidgetContextMenu()

QmitkLevelWindowWidgetContextMenu::QmitkLevelWindowWidgetContextMenu ( QWidget *  parent,
Qt::WindowFlags  f = {} 
)

Constructs the context menu widget.

Parameters
[in]parentThe parent widget.
[in]fOptional window flags.

◆ ~QmitkLevelWindowWidgetContextMenu()

QmitkLevelWindowWidgetContextMenu::~QmitkLevelWindowWidgetContextMenu ( )
override

Member Function Documentation

◆ GetContextMenu() [1/2]

void QmitkLevelWindowWidgetContextMenu::GetContextMenu ( )

Creates and shows a standalone context menu with standard level/window actions.

◆ GetContextMenu() [2/2]

void QmitkLevelWindowWidgetContextMenu::GetContextMenu ( QMenu *  contextMenu)

Appends standard level/window actions to an existing context menu.

Parameters
[in,out]contextMenuThe menu to which level/window actions are appended.

◆ OnAddPreset

void QmitkLevelWindowWidgetContextMenu::OnAddPreset ( )
protectedslot

adds a new Preset for presets-contextmenu

◆ OnChangeScaleRange

void QmitkLevelWindowWidgetContextMenu::OnChangeScaleRange ( )
protectedslot

changes the current images scalerange

◆ OnSetDefaultLevelWindow

void QmitkLevelWindowWidgetContextMenu::OnSetDefaultLevelWindow ( )
protectedslot

resets the current images Level/Window to its default values

◆ OnSetDefaultScaleRange

void QmitkLevelWindowWidgetContextMenu::OnSetDefaultScaleRange ( )
protectedslot

resets the current images scalerange to its default values

◆ OnSetFixed

void QmitkLevelWindowWidgetContextMenu::OnSetFixed ( )
protectedslot

sets the level window slider to be fixed

◆ OnSetImage

void QmitkLevelWindowWidgetContextMenu::OnSetImage ( QAction *  imageAction)
protectedslot

sets the selected image or the topmost layer image to the new current image

◆ OnSetMaximumWindow

void QmitkLevelWindowWidgetContextMenu::OnSetMaximumWindow ( )
protectedslot

sets the window to its maximum Size to fit the scalerange

◆ OnSetPreset

void QmitkLevelWindowWidgetContextMenu::OnSetPreset ( const QAction *  presetAction)
protectedslot

sets level and window value of the current image to the values defined for the selected preset

◆ OnUseAllGreyvaluesFromImage

void QmitkLevelWindowWidgetContextMenu::OnUseAllGreyvaluesFromImage ( )
protectedslot

calls the mitkLevelWindow SetToImageRange method, so that the greyvalues from whole image will be used

◆ OnUseOptimizedLevelWindow

void QmitkLevelWindowWidgetContextMenu::OnUseOptimizedLevelWindow ( )
protectedslot

calls the mitkLevelWindow SetAuto method with guessByCentralSlice false, so that the greyvalues from whole image will be considered

◆ SetLevelWindowManager()

void QmitkLevelWindowWidgetContextMenu::SetLevelWindowManager ( mitk::LevelWindowManager *  levelWindowManager)

Sets the LevelWindowManager used for image queries and change notifications.

Parameters
[in]levelWindowManagerThe LevelWindowManager to use.

Member Data Documentation

◆ m_AutoTopmostAction

QAction* QmitkLevelWindowWidgetContextMenu::m_AutoTopmostAction
protected

Definition at line 87 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_Images

std::map<QAction *, mitk::LevelWindowProperty::Pointer> QmitkLevelWindowWidgetContextMenu::m_Images

Maps context menu actions to their associated LevelWindowProperty for image selection.

Definition at line 65 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_ImageSubmenu

QMenu* QmitkLevelWindowWidgetContextMenu::m_ImageSubmenu

Submenu listing all available images.

Definition at line 59 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_LevelWindow

mitk::LevelWindow QmitkLevelWindowWidgetContextMenu::m_LevelWindow

Stores the current level/window values manipulated by the context menu.

Definition at line 53 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_LevelWindowPreset

mitk::LevelWindowPreset* QmitkLevelWindowWidgetContextMenu::m_LevelWindowPreset

Handles reading and writing of level/window presets from an XML file.

Definition at line 50 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_Manager

mitk::LevelWindowManager* QmitkLevelWindowWidgetContextMenu::m_Manager

The LevelWindowManager that tracks level/window changes and holds the current image's LevelWindowProperty.

Definition at line 62 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_PresetAction

QAction* QmitkLevelWindowWidgetContextMenu::m_PresetAction
protected

Definition at line 86 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_PresetSubmenu

QMenu* QmitkLevelWindowWidgetContextMenu::m_PresetSubmenu

Submenu listing all available presets.

Definition at line 56 of file QmitkLevelWindowWidgetContextMenu.h.

◆ m_SelectedImagesAction

QAction* QmitkLevelWindowWidgetContextMenu::m_SelectedImagesAction
protected

Definition at line 88 of file QmitkLevelWindowWidgetContextMenu.h.


The documentation for this class was generated from the following file: