Computer Assited Medical Intervention Tool Kit
version 4.1
|
The class ImageLutWidget defines a widget controling the Look Up Table of an instance of ImageComponent. More...
#include <ImageLutWidget.h>
Inherits QWidget.
Public Member Functions | |
ImageLutWidget (QWidget *parent=nullptr) | |
Default construtor. More... | |
void | updateComponent (camitk::ImageComponent *) |
load the LUT data using the LUT from the image component More... | |
~ImageLutWidget () override | |
destructor More... | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *) override |
overwritten from QWidget to ensure fit in view, see fitView() More... | |
void | showEvent (QShowEvent *) override |
overwritten from QWidget to ensure fit in view, see fitView() More... | |
Private Slots | |
void | applyLUT () |
Update the component LUT using the GUI values. More... | |
void | invertButtonClicked () |
Slot called when the invert button is clicked. More... | |
void | lineEditLUTLevelChanged () |
Slot called when the line edit for the lut level has changed. More... | |
void | lineEditLUTWindowChanged () |
Slot called when the line edit for the window width has changed. More... | |
virtual void | resetLUT () |
Slot that reset changed applied to the LUT. More... | |
void | setMaxColor () |
slot called when the max color button is clicked More... | |
void | setMinColor () |
slot called when the min color button is clicked More... | |
void | sliderLUTLevelChanged (int) |
Slot called when the slider for the lut level has changed. More... | |
void | sliderLUTWindowChanged (int) |
Slot called when the slider for the window width has changed. More... | |
Private Member Functions | |
void | blockAllSignals (bool) |
block/unblock signals for all the GUI widgets More... | |
void | draw () |
draws the histogram and LUT graphic representation More... | |
template<class DATATYPE > | |
void | fillHistogramTable (DATATYPE *data, unsigned int dataDim, DATATYPE minVal, DATATYPE maxVal) |
fill the data for the histogram More... | |
void | fitView () |
ensure that all graphics are completely visible and only that More... | |
void | initLevelGUI (int min, int max, int value) |
Init level slider and text with its minimum, maximum and current value. More... | |
void | initSlider (QSlider *slider, int min, int max, int value) |
init a slider More... | |
void | initWindowGUI (int min, int max, int value) |
Init window slider and text with its minimum, maximum and current value. More... | |
void | updateGradient () |
update the gradient display in the widget More... | |
Private Attributes | |
double * | greyLevels |
Table containing histogram bins. More... | |
double | highestGreyLevel |
highest number of grey level (highest value in greyLevels array) More... | |
bool | invert |
does the user asked for an invert LUT More... | |
double | lutMax |
Min the possible data value (given by the data type of the image) More... | |
double | lutMin |
Min the possible data value (given by the data type of the image) More... | |
camitk::ImageComponent * | myComponent |
the current ImageComponent More... | |
unsigned int | nbHistoBins |
size of greyLevels More... | |
QGraphicsRectItem * | sceneRectItem |
the graphics item around all other item in the graphics view More... | |
Ui::ui_ImageLutWidget | ui |
the Qt GUI (build by ImageLutWidget.ui) More... | |
The class ImageLutWidget defines a widget controling the Look Up Table of an instance of ImageComponent.
ImageLutWidget::ImageLutWidget | ( | QWidget * | parent = nullptr | ) |
Default construtor.
References applyLUT(), greyLevels, initSlider(), invertButtonClicked(), lineEditLUTLevelChanged(), lineEditLUTWindowChanged(), lutMax, lutMin, myComponent, nbHistoBins, resetLUT(), setMaxColor(), setMinColor(), sliderLUTLevelChanged(), sliderLUTWindowChanged(), and ui.
|
override |
destructor
References greyLevels.
|
privateslot |
Update the component LUT using the GUI values.
References draw(), camitk::ImageComponent::getLut(), invert, myComponent, camitk::ImageComponent::refresh(), and ui.
Referenced by ImageLutWidget(), invertButtonClicked(), lineEditLUTLevelChanged(), lineEditLUTWindowChanged(), resetLUT(), setMaxColor(), setMinColor(), sliderLUTLevelChanged(), sliderLUTWindowChanged(), and updateComponent().
|
private |
block/unblock signals for all the GUI widgets
References ui.
Referenced by lineEditLUTLevelChanged(), lineEditLUTWindowChanged(), resetLUT(), sliderLUTLevelChanged(), sliderLUTWindowChanged(), and updateComponent().
|
private |
draws the histogram and LUT graphic representation
References fitView(), camitk::ImageComponent::getImageData(), camitk::ImageComponent::getLut(), greyLevels, highestGreyLevel, lutMax, lutMin, myComponent, nbHistoBins, sceneRectItem, and ui.
Referenced by applyLUT().
|
private |
fill the data for the histogram
References CAMITK_ERROR, greyLevels, highestGreyLevel, and nbHistoBins.
|
private |
ensure that all graphics are completely visible and only that
References sceneRectItem, and ui.
Referenced by draw(), resizeEvent(), and showEvent().
|
private |
Init level slider and text with its minimum, maximum and current value.
References initSlider(), and ui.
Referenced by resetLUT(), and updateComponent().
|
private |
init a slider
Referenced by ImageLutWidget(), initLevelGUI(), and initWindowGUI().
|
private |
Init window slider and text with its minimum, maximum and current value.
References initSlider(), and ui.
Referenced by resetLUT(), and updateComponent().
|
privateslot |
Slot called when the invert button is clicked.
References applyLUT(), invert, and updateGradient().
Referenced by ImageLutWidget().
|
privateslot |
Slot called when the line edit for the lut level has changed.
References applyLUT(), blockAllSignals(), and ui.
Referenced by ImageLutWidget().
|
privateslot |
Slot called when the line edit for the window width has changed.
References applyLUT(), blockAllSignals(), and ui.
Referenced by ImageLutWidget().
|
privatevirtualslot |
Slot that reset changed applied to the LUT.
References applyLUT(), blockAllSignals(), initLevelGUI(), initWindowGUI(), invert, lutMax, lutMin, and ui.
Referenced by ImageLutWidget().
|
overrideprotected |
|
privateslot |
slot called when the max color button is clicked
References applyLUT(), ui, and updateGradient().
Referenced by ImageLutWidget().
|
privateslot |
slot called when the min color button is clicked
References applyLUT(), ui, and updateGradient().
Referenced by ImageLutWidget().
|
overrideprotected |
|
privateslot |
Slot called when the slider for the lut level has changed.
References applyLUT(), blockAllSignals(), and ui.
Referenced by ImageLutWidget().
|
privateslot |
Slot called when the slider for the window width has changed.
References applyLUT(), blockAllSignals(), and ui.
Referenced by ImageLutWidget().
void ImageLutWidget::updateComponent | ( | camitk::ImageComponent * | comp | ) |
load the LUT data using the LUT from the image component
References applyLUT(), blockAllSignals(), camitk::ImageComponent::getImageData(), camitk::ImageComponent::getLut(), greyLevels, initLevelGUI(), initWindowGUI(), invert, lutMax, lutMin, myComponent, nbHistoBins, ui, and updateGradient().
|
private |
update the gradient display in the widget
References ui.
Referenced by invertButtonClicked(), setMaxColor(), setMinColor(), and updateComponent().
|
private |
Table containing histogram bins.
Referenced by draw(), fillHistogramTable(), ImageLutWidget(), updateComponent(), and ~ImageLutWidget().
|
private |
highest number of grey level (highest value in greyLevels array)
Referenced by draw(), and fillHistogramTable().
|
private |
does the user asked for an invert LUT
Referenced by applyLUT(), invertButtonClicked(), resetLUT(), and updateComponent().
|
private |
Min the possible data value (given by the data type of the image)
Referenced by draw(), ImageLutWidget(), resetLUT(), and updateComponent().
|
private |
Min the possible data value (given by the data type of the image)
Referenced by draw(), ImageLutWidget(), resetLUT(), and updateComponent().
|
private |
the current ImageComponent
Referenced by applyLUT(), draw(), ImageLutWidget(), and updateComponent().
|
private |
size of greyLevels
Referenced by draw(), fillHistogramTable(), ImageLutWidget(), and updateComponent().
|
private |
|
private |
the Qt GUI (build by ImageLutWidget.ui)
Referenced by applyLUT(), blockAllSignals(), draw(), fitView(), ImageLutWidget(), initLevelGUI(), initWindowGUI(), lineEditLUTLevelChanged(), lineEditLUTWindowChanged(), resetLUT(), setMaxColor(), setMinColor(), sliderLUTLevelChanged(), sliderLUTWindowChanged(), updateComponent(), and updateGradient().