GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GoTransferFunctionEditorWidget Class Reference

#include <Code/GUI/lib/TransferFunctionEditor/GoTransferFunctionEditorWidget.h>

Inheritance diagram for GoTransferFunctionEditorWidget:
Inheritance graph
[legend]
Collaboration diagram for GoTransferFunctionEditorWidget:
Collaboration graph
[legend]

Public Slots

void AdjustWindowLevel (double iMin, double iMax)
 Adjust window/level between the input values. LUT (using the gamma value) will be calculated between those 2 points. Before iMin, LUT = (0, 0, 0) After iMax, LUT = ChannelColor. It modifies the values of the sliders then update the LUT. More...
 
void ApplyChanges ()
 Apply changes (color, min, manx, gamma, opacity TF) to the channel. It modifies informations relative to the given channel in the QGoImageStructure. More...
 
void ChangeColor ()
 Opens a QColorDialog. If chosen color is valid, then: 1- Modify push button color 2- Modify m_TFWidget color 3- Update LUT. More...
 
void ResetLUT ()
 Reset the channel to its original state (color, LUT, opacity) More...
 
void ShowHistogram (bool iShow)
 Show/hide histogram in m_TFWidget. More...
 
void UpdateLUT ()
 Update the LUT based on the min, max and gamma. It updates the m_TFWidget and the visualition. More...
 
void updateOpacityTF ()
 
void updateSliders (int iValue)
 When Min and Max sliders change, update the value of the one which sent the signal, if it doesn't overlap with the other one. param[in] iValue new value. Else modify its value back to original. More...
 

Signals

void UpdateImageStructure (QString, std::map< unsigned int, unsigned int >, QColor, int, int, int)
 Modify the image structure when apply clicked. More...
 
void updateVisualization ()
 Modify the visualization when the LUT or opacity changed. More...
 

Public Member Functions

void AddColor (const std::vector< double > &iColor)
 Add color of the channel to the GoTransferFunctionEditorWidget. It modifies m_Color. m_Color is necessary for reset and to initialize the m_TFWidget;. More...
 
void AddHistogram (vtkImageAccumulate *iHistogram)
 1- Add Histogram to the GoTransferFunctionEditorWidget 2- Convert it to QVector<qreal> 3- Add it to the m_TFWidget 4- Update the m_TFWidget More...
 
void AddLookupTable (vtkLookupTable *iLUT)
 Add LUT to the GoTransferFunctionEditorWidget. More...
 
void AddName (QString iChannel)
 Add name of the channel to the GoTransferFunctionEditorWidget. More...
 
void AddOpacityTransferFunction (vtkPiecewiseFunction *iOpacity)
 Add pointer to the opacity TF for a direct access. More...
 
void AddPoints (const std::map< unsigned int, unsigned int > &iPoints)
 Add points to both LUT and Opacity transfer function. More...
 
 GoTransferFunctionEditorWidget (QString iChannel, const std::vector< double > &iColor, std::vector< int > iLUTParameters, double iMax, QWidget *parent=0)
 
void SetMaximumValue (double iMax)
 

Private Member Functions

void ConvertQPolygonFToSTDMap (const QPolygonF &iPoints, std::map< unsigned int, unsigned int > &iMap)
 Convenience method to convert a QPolygonF to a std::map. More...
 
void ConvertSTDMapToQPolygonF (const std::map< unsigned int, unsigned int > &iMap, QPolygonF &iPoints)
 Convenience method to convert a std::map to a QPolygonF. More...
 

Private Attributes

QString m_Channel
 Name of the channel. More...
 
QColor m_Color
 Current color of the channel. More...
 
QColor m_Color_original
 Original color of the channel. More...
 
QPushButton * m_ColorPushButton
 Push button to modify the color. More...
 
QSlider * m_GammaSlider
 Slider to modify the value of gamma. More...
 
QVector< qreal > m_Histogram
 Histogram of the current channel for current time point. More...
 
vtkLookupTable * m_LUT
 Pointer to the channel LUT. More...
 
double m_Max
 Maximum pixel intensity for the channel at current time point. More...
 
QSlider * m_MaxSlider
 Slider to modify the max value. More...
 
QSlider * m_MinSlider
 Slider to modify the min value. More...
 
vtkPiecewiseFunction * m_OpacityTF
 Pointer to the channel opacity LUT. More...
 
GoTransferFunctionWidgetm_TFWidget
 The widget containing the shade, histogram, LUT and opacity TF. More...
 

Detailed Description

Definition at line 104 of file GoTransferFunctionEditorWidget.h.

Constructor & Destructor Documentation

GoTransferFunctionEditorWidget::GoTransferFunctionEditorWidget ( QString  iChannel,
const std::vector< double > &  iColor,
std::vector< int >  iLUTParameters,
double  iMax,
QWidget *  parent = 0 
)
explicit

Definition at line 101 of file GoTransferFunctionEditorWidget.cxx.

Member Function Documentation

void GoTransferFunctionEditorWidget::AddColor ( const std::vector< double > &  iColor)

Add color of the channel to the GoTransferFunctionEditorWidget. It modifies m_Color. m_Color is necessary for reset and to initialize the m_TFWidget;.

Parameters
[in]iColoris a vector of size 4 (RGBA), with values between 0 and 255. Add color then normalize the values between 0 and 1.

Definition at line 443 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AddHistogram ( vtkImageAccumulate *  iHistogram)

1- Add Histogram to the GoTransferFunctionEditorWidget 2- Convert it to QVector<qreal> 3- Add it to the m_TFWidget 4- Update the m_TFWidget

Parameters
[in]iHistograma vtkImage Accumulate

Definition at line 412 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AddLookupTable ( vtkLookupTable *  iLUT)

Add LUT to the GoTransferFunctionEditorWidget.

Parameters
[in]iLUTthe vtk Look Up Table

Definition at line 394 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AddName ( QString  iChannel)

Add name of the channel to the GoTransferFunctionEditorWidget.

Parameters
[in]iChannelname of the channel

Definition at line 455 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AddOpacityTransferFunction ( vtkPiecewiseFunction *  iOpacity)

Add pointer to the opacity TF for a direct access.

Definition at line 403 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AddPoints ( const std::map< unsigned int, unsigned int > &  iPoints)

Add points to both LUT and Opacity transfer function.

Parameters
[in]iPointsmap containing the points. The key is the "X" poisition, the value is the "Y" position.

Definition at line 351 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::AdjustWindowLevel ( double  iMin,
double  iMax 
)
slot

Adjust window/level between the input values. LUT (using the gamma value) will be calculated between those 2 points. Before iMin, LUT = (0, 0, 0) After iMax, LUT = ChannelColor. It modifies the values of the sliders then update the LUT.

Parameters
[in]iMinpixel intensity below which the pixels will be mapped to black
[in]iMaxpixel intensity above which the pixels will be mapped to the channel color

Definition at line 609 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ApplyChanges ( )
slot

Apply changes (color, min, manx, gamma, opacity TF) to the channel. It modifies informations relative to the given channel in the QGoImageStructure.

Definition at line 493 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ChangeColor ( )
slot

Opens a QColorDialog. If chosen color is valid, then: 1- Modify push button color 2- Modify m_TFWidget color 3- Update LUT.

Definition at line 563 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ConvertQPolygonFToSTDMap ( const QPolygonF &  iPoints,
std::map< unsigned int, unsigned int > &  iMap 
)
private

Convenience method to convert a QPolygonF to a std::map.

Parameters
[in]iPointsQPolygonF to be converted
[out]iMapstd::map to be filled

Definition at line 513 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ConvertSTDMapToQPolygonF ( const std::map< unsigned int, unsigned int > &  iMap,
QPolygonF &  iPoints 
)
private

Convenience method to convert a std::map to a QPolygonF.

Parameters
[in]iMapstd::map to be converted
[out]iPointsQPolygonF to be filled

Definition at line 369 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ResetLUT ( )
slot

Reset the channel to its original state (color, LUT, opacity)

Definition at line 464 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::SetMaximumValue ( double  iMax)

Set maximum value of the current channel. Useful to adjust the range of the LUT.

Definition at line 625 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::ShowHistogram ( bool  iShow)
slot

Show/hide histogram in m_TFWidget.

Parameters
[in]iShowtrue: paint current histogram, false paint an empty histogram

Definition at line 588 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::UpdateImageStructure ( QString  ,
std::map< unsigned int, unsigned int >  ,
QColor  ,
int  ,
int  ,
int   
)
signal

Modify the image structure when apply clicked.

void GoTransferFunctionEditorWidget::UpdateLUT ( )
slot

Update the LUT based on the min, max and gamma. It updates the m_TFWidget and the visualition.

Definition at line 317 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::updateOpacityTF ( )
slot

Definition at line 537 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::updateSliders ( int  iValue)
slot

When Min and Max sliders change, update the value of the one which sent the signal, if it doesn't overlap with the other one. param[in] iValue new value. Else modify its value back to original.

Definition at line 647 of file GoTransferFunctionEditorWidget.cxx.

void GoTransferFunctionEditorWidget::updateVisualization ( )
signal

Modify the visualization when the LUT or opacity changed.

Member Data Documentation

QString GoTransferFunctionEditorWidget::m_Channel
private

Name of the channel.

Definition at line 287 of file GoTransferFunctionEditorWidget.h.

QColor GoTransferFunctionEditorWidget::m_Color
private

Current color of the channel.

Definition at line 277 of file GoTransferFunctionEditorWidget.h.

QColor GoTransferFunctionEditorWidget::m_Color_original
private

Original color of the channel.

Definition at line 282 of file GoTransferFunctionEditorWidget.h.

QPushButton* GoTransferFunctionEditorWidget::m_ColorPushButton
private

Push button to modify the color.

Definition at line 252 of file GoTransferFunctionEditorWidget.h.

QSlider* GoTransferFunctionEditorWidget::m_GammaSlider
private

Slider to modify the value of gamma.

Definition at line 262 of file GoTransferFunctionEditorWidget.h.

QVector<qreal> GoTransferFunctionEditorWidget::m_Histogram
private

Histogram of the current channel for current time point.

Definition at line 302 of file GoTransferFunctionEditorWidget.h.

vtkLookupTable* GoTransferFunctionEditorWidget::m_LUT
private

Pointer to the channel LUT.

Definition at line 292 of file GoTransferFunctionEditorWidget.h.

double GoTransferFunctionEditorWidget::m_Max
private

Maximum pixel intensity for the channel at current time point.

Definition at line 307 of file GoTransferFunctionEditorWidget.h.

QSlider* GoTransferFunctionEditorWidget::m_MaxSlider
private

Slider to modify the max value.

Definition at line 272 of file GoTransferFunctionEditorWidget.h.

QSlider* GoTransferFunctionEditorWidget::m_MinSlider
private

Slider to modify the min value.

Definition at line 267 of file GoTransferFunctionEditorWidget.h.

vtkPiecewiseFunction* GoTransferFunctionEditorWidget::m_OpacityTF
private

Pointer to the channel opacity LUT.

Definition at line 297 of file GoTransferFunctionEditorWidget.h.

GoTransferFunctionWidget* GoTransferFunctionEditorWidget::m_TFWidget
private

The widget containing the shade, histogram, LUT and opacity TF.

Definition at line 257 of file GoTransferFunctionEditorWidget.h.


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