CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::ImageTFData Class Reference

Data class for Transfer Function info, either 2D or 3D. More...

#include <cxImageTFData.h>

Inheritance diagram for cx::ImageTFData:
cx::ImageLUT2D cx::ImageTF3D

Signals

void transferFunctionsChanged ()
 

Public Member Functions

 ImageTFData ()
 
virtual ~ImageTFData ()
 
void setAlpha (double val)
 range [0..1] More...
 
double getAlpha () const
 
void setLLR (double val)
 range [scalarMin..scalarMax] More...
 
double getLLR () const
 
void setWindow (double val)
 range [1..scalarMax-scalarMin] More...
 
double getWindow () const
 
void setLevel (double val)
 range [scalarMin..scalarMax] More...
 
double getLevel () const
 
IntIntMap getOpacityMap ()
 
ColorMap getColorMap ()
 
void resetAlpha (IntIntMap val)
 
void addAlphaPoint (int alphaPosition, int alphaValue)
 Add point to the opacity transfer function. More...
 
void removeAlphaPoint (int alphaPosition)
 Remove point from the opacity transfer function. More...
 
void moveAlphaPoint (int oldpos, int newpos, int alphaValue)
 
void resetColor (ColorMap val)
 
void addColorPoint (int colorPosition, QColor colorValue)
 Add point to the color transfer function. More...
 
void removeColorPoint (int colorPosition)
 Remove point from the color transfer function. More...
 
void moveColorPoint (int oldpos, int newpos, QColor colorValue)
 
virtual void addXml (QDomNode dataNode)
 adds xml information about the transferfunction and its variabels More...
 
virtual void parseXml (QDomNode dataNode)
 Use a XML node to load data. More...
 
void unsignedCT (bool onLoad)
 
void shift (int val)
 shift the transfter function index values by the input amount. Used for signed/unsigned conversion. More...
 
vtkColorTransferFunctionPtr generateColorTF () const
 
vtkPiecewiseFunctionPtr generateOpacityTF () const
 

Protected Member Functions

void deepCopy (ImageTFData *source)
 
virtual void internalsHaveChanged ()
 
void fillOpacityTFFromMap (vtkPiecewiseFunctionPtr tf) const
 
void fillColorTFFromMap (vtkColorTransferFunctionPtr tf) const
 
void shiftColor (int shift, double center, double scale)
 
void shiftOpacity (int shift)
 

Protected Attributes

IntIntMap mOpacityMap
 
ColorMap mColorMap
 

Detailed Description

Data class for Transfer Function info, either 2D or 3D.

Used as base for ImageTF3D and ImageLUT2D.

Alpha transfer function: Set either LLR/alpha or OpacityMap, this updates the data as shown.

    set            set
     |              |
  LLR/alpha --> OpacityMap --> alphaTF

Color transfer function: Set either ColorMap or LUT, plus the Win/Level, this updates the data as shown.

    set        set
     |          |
  ColorMap --> LUT -------> colorTF
                        |
             Win/Level--|
                |
               set

Definition at line 97 of file cxImageTFData.h.

Constructor & Destructor Documentation

cx::ImageTFData::ImageTFData ( )

Definition at line 58 of file cxImageTFData.cpp.

cx::ImageTFData::~ImageTFData ( )
virtual

Definition at line 62 of file cxImageTFData.cpp.

Member Function Documentation

void cx::ImageTFData::addAlphaPoint ( int  alphaPosition,
int  alphaValue 
)

Add point to the opacity transfer function.

Definition at line 321 of file cxImageTFData.cpp.

void cx::ImageTFData::addColorPoint ( int  colorPosition,
QColor  colorValue 
)

Add point to the color transfer function.

Definition at line 338 of file cxImageTFData.cpp.

void cx::ImageTFData::addXml ( QDomNode  dataNode)
virtual

adds xml information about the transferfunction and its variabels

Definition at line 72 of file cxImageTFData.cpp.

void cx::ImageTFData::deepCopy ( ImageTFData source)
protected

Definition at line 66 of file cxImageTFData.cpp.

void cx::ImageTFData::fillColorTFFromMap ( vtkColorTransferFunctionPtr  tf) const
protected

Definition at line 383 of file cxImageTFData.cpp.

void cx::ImageTFData::fillOpacityTFFromMap ( vtkPiecewiseFunctionPtr  tf) const
protected

Definition at line 394 of file cxImageTFData.cpp.

vtkColorTransferFunctionPtr cx::ImageTFData::generateColorTF ( ) const

Definition at line 369 of file cxImageTFData.cpp.

vtkPiecewiseFunctionPtr cx::ImageTFData::generateOpacityTF ( ) const

Definition at line 376 of file cxImageTFData.cpp.

double cx::ImageTFData::getAlpha ( ) const

Definition at line 252 of file cxImageTFData.cpp.

ColorMap cx::ImageTFData::getColorMap ( )
Returns
The values of the color transfer function. Key range [scalarMin..scalarMax].

Definition at line 317 of file cxImageTFData.cpp.

double cx::ImageTFData::getLevel ( ) const

Definition at line 303 of file cxImageTFData.cpp.

double cx::ImageTFData::getLLR ( ) const

Definition at line 211 of file cxImageTFData.cpp.

IntIntMap cx::ImageTFData::getOpacityMap ( )
Returns
The values of the opacity transfer function. Key range [scalarMin..scalarMax], Value range [0..255].

Definition at line 313 of file cxImageTFData.cpp.

double cx::ImageTFData::getWindow ( ) const

Definition at line 279 of file cxImageTFData.cpp.

virtual void cx::ImageTFData::internalsHaveChanged ( )
inlineprotectedvirtual

Reimplemented in cx::ImageTF3D, and cx::ImageLUT2D.

Definition at line 140 of file cxImageTFData.h.

void cx::ImageTFData::moveAlphaPoint ( int  oldpos,
int  newpos,
int  alphaValue 
)

Definition at line 332 of file cxImageTFData.cpp.

void cx::ImageTFData::moveColorPoint ( int  oldpos,
int  newpos,
QColor  colorValue 
)

Definition at line 350 of file cxImageTFData.cpp.

void cx::ImageTFData::parseXml ( QDomNode  dataNode)
virtual

Use a XML node to load data.

Parameters
dataNodeA XML data representation of this object.

Definition at line 99 of file cxImageTFData.cpp.

void cx::ImageTFData::removeAlphaPoint ( int  alphaPosition)

Remove point from the opacity transfer function.

Definition at line 327 of file cxImageTFData.cpp.

void cx::ImageTFData::removeColorPoint ( int  colorPosition)

Remove point from the color transfer function.

Definition at line 344 of file cxImageTFData.cpp.

void cx::ImageTFData::resetAlpha ( IntIntMap  val)

Definition at line 357 of file cxImageTFData.cpp.

void cx::ImageTFData::resetColor ( ColorMap  val)

Definition at line 363 of file cxImageTFData.cpp.

void cx::ImageTFData::setAlpha ( double  val)

range [0..1]

Definition at line 224 of file cxImageTFData.cpp.

void cx::ImageTFData::setLevel ( double  val)

range [scalarMin..scalarMax]

Set Level, i.e. the position of the intensity window that will be visible.

Definition at line 290 of file cxImageTFData.cpp.

void cx::ImageTFData::setLLR ( double  val)

range [scalarMin..scalarMax]

Set Low Level Reject, meaning the lowest intensity value that will be visible.

Definition at line 201 of file cxImageTFData.cpp.

void cx::ImageTFData::setWindow ( double  val)

range [1..scalarMax-scalarMin]

Set Window, i.e. the size of the intensity window that will be visible.

Definition at line 265 of file cxImageTFData.cpp.

void cx::ImageTFData::shift ( int  val)

shift the transfter function index values by the input amount. Used for signed/unsigned conversion.

Definition at line 168 of file cxImageTFData.cpp.

void cx::ImageTFData::shiftColor ( int  shift,
double  center,
double  scale 
)
protected

Definition at line 176 of file cxImageTFData.cpp.

void cx::ImageTFData::shiftOpacity ( int  shift)
protected

Definition at line 188 of file cxImageTFData.cpp.

void cx::ImageTFData::transferFunctionsChanged ( )
signal
void cx::ImageTFData::unsignedCT ( bool  onLoad)

Modify transfer function for unsigned CT. This is necessary CT transfer functions are stored as signed.

Parameters
onLoadtrue: add 1024 to preset transfer function values (Use after a preset is loaded) false: subtract 1024 from transfer function values (Use before saving a new preset, remember to revert back afterwards)

Definition at line 154 of file cxImageTFData.cpp.

Member Data Documentation

ColorMap cx::ImageTFData::mColorMap
protected

Definition at line 148 of file cxImageTFData.h.

IntIntMap cx::ImageTFData::mOpacityMap
protected

Definition at line 147 of file cxImageTFData.h.


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