CustusX  20.03-rc1
An IGT application
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 76 of file cxImageTFData.h.

Constructor & Destructor Documentation

cx::ImageTFData::ImageTFData ( )

Definition at line 38 of file cxImageTFData.cpp.

cx::ImageTFData::~ImageTFData ( )
virtual

Definition at line 42 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 302 of file cxImageTFData.cpp.

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

Add point to the color transfer function.

Definition at line 319 of file cxImageTFData.cpp.

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

adds xml information about the transferfunction and its variabels

Definition at line 52 of file cxImageTFData.cpp.

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

Definition at line 46 of file cxImageTFData.cpp.

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

Definition at line 364 of file cxImageTFData.cpp.

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

Definition at line 375 of file cxImageTFData.cpp.

vtkColorTransferFunctionPtr cx::ImageTFData::generateColorTF ( ) const

Definition at line 350 of file cxImageTFData.cpp.

vtkPiecewiseFunctionPtr cx::ImageTFData::generateOpacityTF ( ) const

Definition at line 357 of file cxImageTFData.cpp.

double cx::ImageTFData::getAlpha ( ) const

Definition at line 233 of file cxImageTFData.cpp.

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

Definition at line 298 of file cxImageTFData.cpp.

double cx::ImageTFData::getLevel ( ) const

Definition at line 284 of file cxImageTFData.cpp.

double cx::ImageTFData::getLLR ( ) const

Definition at line 192 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 294 of file cxImageTFData.cpp.

double cx::ImageTFData::getWindow ( ) const

Definition at line 260 of file cxImageTFData.cpp.

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

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

Definition at line 119 of file cxImageTFData.h.

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

Definition at line 313 of file cxImageTFData.cpp.

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

Definition at line 331 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 79 of file cxImageTFData.cpp.

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

Remove point from the opacity transfer function.

Definition at line 308 of file cxImageTFData.cpp.

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

Remove point from the color transfer function.

Definition at line 325 of file cxImageTFData.cpp.

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

Definition at line 338 of file cxImageTFData.cpp.

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

Definition at line 344 of file cxImageTFData.cpp.

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

range [0..1]

Definition at line 205 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 271 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 182 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 246 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 149 of file cxImageTFData.cpp.

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

Definition at line 157 of file cxImageTFData.cpp.

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

Definition at line 169 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 135 of file cxImageTFData.cpp.

Member Data Documentation

ColorMap cx::ImageTFData::mColorMap
protected

Definition at line 127 of file cxImageTFData.h.

IntIntMap cx::ImageTFData::mOpacityMap
protected

Definition at line 126 of file cxImageTFData.h.


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