Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ImageLutWidget Class Reference

The class ImageLutWidget defines a widget controling the Look Up Table of an instance of ImageComponent. More...

#include <ImageLutWidget.h>

+ Inheritance diagram for ImageLutWidget:

Public Member Functions

 ImageLutWidget (QWidget *parent=0)
 Default construtor. More...
 
void updateComponent (ImageComponent *)
 load the LUT data using the LUT from the image component More...
 
 ~ImageLutWidget ()
 destructor More...
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *)
 overwritten from QWidget to ensure fit in view More...
 
virtual void showEvent (QShowEvent *)
 overwritten from QWidget to ensure fit in view 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

unsigned int * greyLevels
 Table containing histogram bins. More...
 
unsigned int 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...
 
ImageComponentmyComponent
 the current ImageComponent More...
 
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...
 

Detailed Description

The class ImageLutWidget defines a widget controling the Look Up Table of an instance of ImageComponent.

The ui is defined in the corresponding ImageLutWidget.ui

Constructor & Destructor Documentation

ImageLutWidget::ImageLutWidget ( QWidget *  parent = 0)
ImageLutWidget::~ImageLutWidget ( )

destructor

References greyLevels.

Member Function Documentation

void ImageLutWidget::applyLUT ( )
privateslot
void ImageLutWidget::blockAllSignals ( bool  block)
private

block/unblock signals for all the GUI widgets

References ui.

Referenced by lineEditLUTLevelChanged(), lineEditLUTWindowChanged(), resetLUT(), sliderLUTLevelChanged(), sliderLUTWindowChanged(), and updateComponent().

void ImageLutWidget::draw ( )
private
template<class DATATYPE >
void ImageLutWidget::fillHistogramTable ( DATATYPE *  data,
unsigned int  dataDim,
DATATYPE  minVal,
DATATYPE  maxVal 
)
private

fill the data for the histogram

References greyLevels, highestGreyLevel, and nbHistoBins.

void ImageLutWidget::fitView ( )
private

ensure that all graphics are completely visible and only that

References sceneRectItem, and ui.

Referenced by draw(), resizeEvent(), and showEvent().

void ImageLutWidget::initLevelGUI ( int  min,
int  max,
int  value 
)
private

Init level slider and text with its minimum, maximum and current value.

References initSlider(), and ui.

Referenced by resetLUT(), and updateComponent().

void ImageLutWidget::initSlider ( QSlider *  slider,
int  min,
int  max,
int  value 
)
private

init a slider

Referenced by ImageLutWidget(), initLevelGUI(), and initWindowGUI().

void ImageLutWidget::initWindowGUI ( int  min,
int  max,
int  value 
)
private

Init window slider and text with its minimum, maximum and current value.

References initSlider(), and ui.

Referenced by resetLUT(), and updateComponent().

void ImageLutWidget::invertButtonClicked ( )
privateslot

Slot called when the invert button is clicked.

References applyLUT(), invert, and updateGradient().

Referenced by ImageLutWidget().

void ImageLutWidget::lineEditLUTLevelChanged ( )
privateslot

Slot called when the line edit for the lut level has changed.

References applyLUT(), blockAllSignals(), and ui.

Referenced by ImageLutWidget().

void ImageLutWidget::lineEditLUTWindowChanged ( )
privateslot

Slot called when the line edit for the window width has changed.

References applyLUT(), blockAllSignals(), and ui.

Referenced by ImageLutWidget().

void ImageLutWidget::resetLUT ( )
privatevirtualslot

Slot that reset changed applied to the LUT.

References applyLUT(), blockAllSignals(), initLevelGUI(), initWindowGUI(), invert, lutMax, lutMin, and ui.

Referenced by ImageLutWidget().

void ImageLutWidget::resizeEvent ( QResizeEvent *  )
protectedvirtual

overwritten from QWidget to ensure fit in view

See Also
fitView

References fitView().

void ImageLutWidget::setMaxColor ( )
privateslot

slot called when the max color button is clicked

References applyLUT(), ui, and updateGradient().

Referenced by ImageLutWidget().

void ImageLutWidget::setMinColor ( )
privateslot

slot called when the min color button is clicked

References applyLUT(), ui, and updateGradient().

Referenced by ImageLutWidget().

void ImageLutWidget::showEvent ( QShowEvent *  )
protectedvirtual

overwritten from QWidget to ensure fit in view

See Also
fitView

References fitView().

void ImageLutWidget::sliderLUTLevelChanged ( int  level)
privateslot

Slot called when the slider for the lut level has changed.

References applyLUT(), blockAllSignals(), and ui.

Referenced by ImageLutWidget().

void ImageLutWidget::sliderLUTWindowChanged ( int  window)
privateslot

Slot called when the slider for the window width has changed.

References applyLUT(), blockAllSignals(), and ui.

Referenced by ImageLutWidget().

void ImageLutWidget::updateComponent ( ImageComponent comp)
void ImageLutWidget::updateGradient ( )
private

update the gradient display in the widget

References ui.

Referenced by invertButtonClicked(), setMaxColor(), setMinColor(), and updateComponent().

Member Data Documentation

unsigned int* ImageLutWidget::greyLevels
private

Table containing histogram bins.

Referenced by draw(), fillHistogramTable(), ImageLutWidget(), and ~ImageLutWidget().

unsigned int ImageLutWidget::highestGreyLevel
private

highest number of grey level (highest value in greyLevels array)

Referenced by draw(), and fillHistogramTable().

bool ImageLutWidget::invert
private

does the user asked for an invert LUT

Referenced by applyLUT(), invertButtonClicked(), resetLUT(), and updateComponent().

double ImageLutWidget::lutMax
private

Min the possible data value (given by the data type of the image)

Referenced by ImageLutWidget(), resetLUT(), and updateComponent().

double ImageLutWidget::lutMin
private

Min the possible data value (given by the data type of the image)

Referenced by ImageLutWidget(), resetLUT(), and updateComponent().

ImageComponent* ImageLutWidget::myComponent
private

the current ImageComponent

Referenced by applyLUT(), draw(), ImageLutWidget(), and updateComponent().

int ImageLutWidget::nbHistoBins
private

size of greyLevels

Referenced by draw(), fillHistogramTable(), and ImageLutWidget().

QGraphicsRectItem* ImageLutWidget::sceneRectItem
private

the graphics item around all other item in the graphics view

Referenced by draw(), and fitView().

Ui::ui_ImageLutWidget ImageLutWidget::ui
private

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