|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Provides a widget with a slider to change the level and window value of the current image. More...
#include <QmitkSliderLevelWindowWidget.h>


Public Member Functions | |
| QmitkSliderLevelWindowWidget (QWidget *parent=nullptr, Qt::WindowFlags f={}) | |
| Constructs the slider level/window widget. More... | |
| ~QmitkSliderLevelWindowWidget () override | |
| void | SetLevelWindowManager (mitk::LevelWindowManager *levelWindowManager) |
| Sets the LevelWindowManager for this widget. More... | |
| void | SetDataStorage (mitk::DataStorage *ds) |
| Sets the DataStorage that holds all image nodes. More... | |
| mitk::LevelWindowManager * | GetManager () |
| Returns the LevelWindowManager used by this widget. More... | |
Public Attributes | |
| mitk::LevelWindow | m_LevelWindow |
| Stores the current level/window values. More... | |
| mitk::LevelWindowManager::Pointer | m_Manager |
| The LevelWindowManager responsible for collecting and delivering level/window changes. More... | |
Protected Slots | |
| void | HideScale () |
| Hide the scale if "Hide Scale" is selected in the context menu. More... | |
| void | ShowScale () |
| Shows the scale if "Show Scale" is selected in the context menu. More... | |
Protected Member Functions | |
| virtual void | Update () |
| recalculate the size and position of the slider bar More... | |
| void | paintEvent (QPaintEvent *e) override |
| void | mouseMoveEvent (QMouseEvent *mouseEvent) override |
| void | enterEvent (QEnterEvent *event) override |
| void | mousePressEvent (QMouseEvent *mouseEvent) override |
| void | mouseReleaseEvent (QMouseEvent *mouseEvent) override |
| void | resizeEvent (QResizeEvent *event) override |
Protected Attributes | |
| QRect | m_Rect |
| QPoint | m_StartPos |
| bool | m_Resize |
| bool | m_Bottom |
| bool | m_MouseDown |
| bool | m_Leftbutton |
| bool | m_CtrlPressed |
| int | m_MoveHeight |
| bool | m_ScaleVisible |
| QRect | m_LowerBound |
| QRect | m_UpperBound |
| unsigned long | m_ObserverTag |
| bool | m_IsObserverTagSet |
| QFont | m_Font |
| QmitkLevelWindowWidgetContextMenu * | m_Contextmenu |
Provides a widget with a slider to change the level and window value of the current image.
This documentation actually refers to the QmitkLevelWindowWidget and is only put in this class due to technical issues (should be moved later).
The QmitkLevelWindowWidget is a kind of container for a QmitkSliderLevelWindowWidget (this is the cyan bar above the text input fields) and a QmitkLineEditLevelWindowWidget (with two text input fields). It holds a reference to a mitk::LevelWindowManager variable, which keeps the LevelWindowProperty of the currently selected image. Level/Window is manipulated by the text inputs and the Slider to adjust brightness/contrast of a single image. All changes on the slider or in the text input fields affect the current image by giving new values to LevelWindowManager. LevelWindowManager then sends a signal to tell other listeners about changes.
Which image is changed is determined by mitkLevelWindowManager. If m_AutoTopMost is true, always the topmost image in data tree (layer property) is affected by changes. The image which is affected by changes can also be changed by QmitkLevelWindowWidgetContextMenu, the context menu for QmitkSliderLevelWindowWidget and QmitkLineEditLevelWindowWidget. There you have the possibility to set a certain image or always the topmost image in the data tree (layer property) to be affected by changes.
The internal mitk::LevelWindow variable contains a range that is valid for a given image. It should not be possible to move the level/window parameters outside this range. The range can be changed and reset to its default values by QmitkLevelWindowWidgetContextMenu, the context menu for QmitkSliderLevelWindowWidget and QmitkLineEditLevelWindowWidget.
Now for the behaviour of the text inputs: The upper one contains the value of the level (brightness), the lower one shows the window (contrast).
The behaviour of the cyan bar is more obvious: the scale in the background shows the valid range. The cyan bar in front displays the currently selected level/window setting. You can change the level by dragging the bar with the left mouse button or clicking somewhere inside the scalerange with the left mouse button. The window is changed by moving the mouse on the upper or lower bound of the bar until the cursor becomes an vertical double-arrowed symbol. Then you can change the windowsize by clicking the left mouse button and move the mouse upwards or downwards. The bar becomes greater upwards as well as downwards. If you want to change the size of the window in only one direction you have to press the CTRL-key while doing the same as mentioned above. This information is also presented by a tooltip text when moving the mouse on the upper or lower bound of the bar.
Definition at line 77 of file QmitkSliderLevelWindowWidget.h.
| QmitkSliderLevelWindowWidget::QmitkSliderLevelWindowWidget | ( | QWidget * | parent = nullptr, |
| Qt::WindowFlags | f = {} |
||
| ) |
Constructs the slider level/window widget.
| [in] | parent | Optional parent widget. |
| [in] | f | Optional window flags. |
|
override |
|
overrideprotected |
| mitk::LevelWindowManager* QmitkSliderLevelWindowWidget::GetManager | ( | ) |
Returns the LevelWindowManager used by this widget.
|
protectedslot |
Hide the scale if "Hide Scale" is selected in the context menu.
|
overrideprotected |
method implements the component behavior
checks if cursor is on upper or lower bound of slider bar and changes cursor symbol
checks if left mouse button is pressed and if CTRL is pressed and changes sliderbar in move-direction accordingly
|
overrideprotected |
registers events when a mousebutton is pressed
if leftbutton is pressed m_Leftbutton is set to true
also checks if CTRL is pressed and sets the bool variable m_CtrlPressed
|
overrideprotected |
sets the variable m_MouseDown to false
|
overrideprotected |
repaint the slider and the scale
|
overrideprotected |
causes an update of the sliderbar when resizing the window
| void QmitkSliderLevelWindowWidget::SetDataStorage | ( | mitk::DataStorage * | ds | ) |
Sets the DataStorage that holds all image nodes.
| [in] | ds | The data storage to set. |
| void QmitkSliderLevelWindowWidget::SetLevelWindowManager | ( | mitk::LevelWindowManager * | levelWindowManager | ) |
Sets the LevelWindowManager for this widget.
| [in] | levelWindowManager | The manager to use for level/window changes. |
|
protectedslot |
Shows the scale if "Show Scale" is selected in the context menu.
|
protectedvirtual |
recalculate the size and position of the slider bar
|
protected |
Definition at line 137 of file QmitkSliderLevelWindowWidget.h.
|
protected |
data structure which creates the context menu for QmitkLineEditLevelWindowWidget
Definition at line 153 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 140 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 148 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 146 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 139 of file QmitkSliderLevelWindowWidget.h.
| mitk::LevelWindow QmitkSliderLevelWindowWidget::m_LevelWindow |
Stores the current level/window values.
Definition at line 110 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 143 of file QmitkSliderLevelWindowWidget.h.
| mitk::LevelWindowManager::Pointer QmitkSliderLevelWindowWidget::m_Manager |
The LevelWindowManager responsible for collecting and delivering level/window changes.
Definition at line 113 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 138 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 141 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 145 of file QmitkSliderLevelWindowWidget.h.
|
protected |
helper for drawing the component
Definition at line 129 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 136 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 142 of file QmitkSliderLevelWindowWidget.h.
|
protected |
helper for drawing the component
Definition at line 134 of file QmitkSliderLevelWindowWidget.h.
|
protected |
Definition at line 144 of file QmitkSliderLevelWindowWidget.h.