Medical Imaging Interaction Toolkit
2016.11.0
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=nullptr) | |
constructor More... | |
~QmitkSliderLevelWindowWidget () | |
destructor More... | |
void | setLevelWindowManager (mitk::LevelWindowManager *levelWindowManager) |
sets the manager who is responsible to collect and deliver changes on Level/Window More... | |
void | setDataStorage (mitk::DataStorage *ds) |
sets the DataStorage which holds all image-nodes More... | |
mitk::LevelWindowManager * | GetManager () |
returns the manager who is responsible to collect and deliver changes on Level/Window More... | |
Public Attributes | |
mitk::LevelWindow | m_LevelWindow |
mitk::LevelWindowManager::Pointer | m_Manager |
manager who is responsible to collect and deliver changes on Level/Window More... | |
Protected Slots | |
void | hideScale () |
hides the scale if "Hide Scale" is selected in contextmenu More... | |
void | showScale () |
shows the scale if "Show Scale" is selected in contextmenu 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 (QEvent *event) override |
void | mousePressEvent (QMouseEvent *mouseEvent) override |
void | mouseReleaseEvent (QMouseEvent *mouseEvent) override |
virtual 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 81 of file QmitkSliderLevelWindowWidget.h.
QmitkSliderLevelWindowWidget::QmitkSliderLevelWindowWidget | ( | QWidget * | parent = nullptr , |
Qt::WindowFlags | f = nullptr |
||
) |
constructor
Constructor
Definition at line 33 of file QmitkSliderLevelWindowWidget.cpp.
References m_Bottom, m_Contextmenu, m_CtrlPressed, m_Font, m_IsObserverTagSet, m_Manager, m_MouseDown, m_MoveHeight, m_ObserverTag, m_Resize, m_ScaleVisible, mitk::New(), mitk::LevelWindowManager::New(), and update().
QmitkSliderLevelWindowWidget::~QmitkSliderLevelWindowWidget | ( | ) |
destructor
Definition at line 61 of file QmitkSliderLevelWindowWidget.cpp.
References m_IsObserverTagSet, m_Manager, and m_ObserverTag.
|
overrideprotected |
Definition at line 392 of file QmitkSliderLevelWindowWidget.cpp.
References mouseMoveEvent().
mitk::LevelWindowManager * QmitkSliderLevelWindowWidget::GetManager | ( | ) |
returns the manager who is responsible to collect and deliver changes on Level/Window
Definition at line 532 of file QmitkSliderLevelWindowWidget.cpp.
References m_Manager.
|
protectedslot |
hides the scale if "Hide Scale" is selected in contextmenu
Definition at line 515 of file QmitkSliderLevelWindowWidget.cpp.
References m_ScaleVisible, and update().
|
overrideprotected |
method implements the component behaviour
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 movedirection accordingly
Definition at line 260 of file QmitkSliderLevelWindowWidget.cpp.
References mitk::RenderingManager::GetInstance(), mitk::LevelWindow::GetLevel(), mitk::LevelWindow::GetRange(), mitk::LevelWindow::GetRangeMax(), mitk::LevelWindow::GetRangeMin(), mitk::LevelWindow::GetWindow(), mitk::LevelWindow::IsFixed(), m_Bottom, m_CtrlPressed, m_Leftbutton, m_LevelWindow, m_LowerBound, m_Manager, m_MouseDown, m_MoveHeight, m_Rect, m_Resize, m_StartPos, m_UpperBound, mitk::RenderingManager::RequestUpdateAll(), and mitk::LevelWindow::SetLevelWindow().
Referenced by enterEvent(), and mousePressEvent().
|
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
Definition at line 408 of file QmitkSliderLevelWindowWidget.cpp.
References mitk::LevelWindow::IsFixed(), m_CtrlPressed, m_Leftbutton, m_LevelWindow, m_MouseDown, m_StartPos, and mouseMoveEvent().
|
overrideprotected |
sets the variable m_MouseDown to false
Definition at line 445 of file QmitkSliderLevelWindowWidget.cpp.
References mitk::LevelWindow::IsFixed(), m_LevelWindow, and m_MouseDown.
|
overrideprotected |
repaint the slider and the scale
Definition at line 108 of file QmitkSliderLevelWindowWidget.cpp.
References mitk::LevelWindow::GetRange(), mitk::LevelWindow::GetRangeMax(), mitk::LevelWindow::GetRangeMin(), m_Font, m_LevelWindow, m_MoveHeight, m_Rect, and m_ScaleVisible.
|
overrideprotectedvirtual |
causes an update of the sliderbar when resizing the window
Definition at line 436 of file QmitkSliderLevelWindowWidget.cpp.
References m_MoveHeight, and update().
void QmitkSliderLevelWindowWidget::setDataStorage | ( | mitk::DataStorage * | ds | ) |
sets the DataStorage which holds all image-nodes
Definition at line 527 of file QmitkSliderLevelWindowWidget.cpp.
References m_Manager.
void QmitkSliderLevelWindowWidget::setLevelWindowManager | ( | mitk::LevelWindowManager * | levelWindowManager | ) |
sets the manager who is responsible to collect and deliver changes on Level/Window
Definition at line 70 of file QmitkSliderLevelWindowWidget.cpp.
References m_IsObserverTagSet, m_Manager, m_ObserverTag, and mitk::New().
|
protectedslot |
shows the scale if "Show Scale" is selected in contextmenu
Definition at line 521 of file QmitkSliderLevelWindowWidget.cpp.
References m_ScaleVisible, and update().
|
protectedvirtual |
recalculate the size and position of the slider bar
Definition at line 455 of file QmitkSliderLevelWindowWidget.cpp.
References mitk::LevelWindow::GetLowerWindowBound(), mitk::LevelWindow::GetRange(), mitk::LevelWindow::GetRangeMin(), mitk::LevelWindow::GetUpperWindowBound(), mitk::LevelWindow::GetWindow(), m_LevelWindow, m_MoveHeight, m_Rect, and m_ScaleVisible.
Referenced by hideScale(), QmitkSliderLevelWindowWidget(), resizeEvent(), and showScale().
|
protected |
Definition at line 132 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), and QmitkSliderLevelWindowWidget().
|
protected |
data structure which creates the contextmenu for QmitkLineEditLevelWindowWidget
Definition at line 148 of file QmitkSliderLevelWindowWidget.h.
Referenced by QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 135 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 143 of file QmitkSliderLevelWindowWidget.h.
Referenced by paintEvent(), and QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 141 of file QmitkSliderLevelWindowWidget.h.
Referenced by QmitkSliderLevelWindowWidget(), setLevelWindowManager(), and ~QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 134 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
mitk::LevelWindow QmitkSliderLevelWindowWidget::m_LevelWindow |
data structure which stores the values manipulated by a QmitkSliderLevelWindowWidget
Definition at line 96 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), and update().
|
protected |
Definition at line 138 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent().
mitk::LevelWindowManager::Pointer QmitkSliderLevelWindowWidget::m_Manager |
manager who is responsible to collect and deliver changes on Level/Window
Definition at line 99 of file QmitkSliderLevelWindowWidget.h.
Referenced by GetManager(), mouseMoveEvent(), QmitkSliderLevelWindowWidget(), setDataStorage(), setLevelWindowManager(), and ~QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 133 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 136 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), paintEvent(), QmitkSliderLevelWindowWidget(), resizeEvent(), and update().
|
protected |
Definition at line 140 of file QmitkSliderLevelWindowWidget.h.
Referenced by QmitkSliderLevelWindowWidget(), setLevelWindowManager(), and ~QmitkSliderLevelWindowWidget().
|
protected |
helper for drawing the component
Definition at line 124 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), paintEvent(), and update().
|
protected |
Definition at line 131 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), and QmitkSliderLevelWindowWidget().
|
protected |
Definition at line 137 of file QmitkSliderLevelWindowWidget.h.
Referenced by hideScale(), paintEvent(), QmitkSliderLevelWindowWidget(), showScale(), and update().
|
protected |
helper for drawing the component
Definition at line 129 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
protected |
Definition at line 139 of file QmitkSliderLevelWindowWidget.h.
Referenced by mouseMoveEvent().