Medical Imaging Interaction Toolkit  2021.02.99-e55a5d2f
Medical Imaging Interaction Toolkit
mitk::TransferFunction Class Reference

The TransferFunction class A wrapper class for VTK scalar opacity, gradient opacity, and color transfer functions.Holds a copy of each of the three standard VTK transfer functions (scalar opacity, gradient opacity, color) and provides an interface for manipulating their control points. Each original function can be retrieved by a Get() method. More...

#include <mitkTransferFunction.h>

Inheritance diagram for mitk::TransferFunction:
Collaboration diagram for mitk::TransferFunction:

Public Types

typedef std::vector< std::pair< double, double > > ControlPoints
 
typedef std::vector< std::pair< double, itk::RGBPixel< double > > > RGBControlPoints
 
typedef TransferFunction Self
 
typedef itk::DataObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual void SetMin (int _arg)
 Get/Set min/max of transfer function range for initialization. More...
 
virtual void SetMax (int _arg)
 Get/Set min/max of transfer function range for initialization. More...
 
virtual int GetMin ()
 Get/Set min/max of transfer function range for initialization. More...
 
virtual int GetMax ()
 Get/Set min/max of transfer function range for initialization. More...
 
virtual vtkPiecewiseFunction * GetScalarOpacityFunction ()
 Get/Set wrapped vtk transfer function. More...
 
virtual vtkPiecewiseFunction * GetGradientOpacityFunction ()
 Get/Set wrapped vtk transfer function. More...
 
virtual vtkColorTransferFunction * GetColorTransferFunction ()
 Get/Set wrapped vtk transfer function. More...
 
virtual void SetColorTransferFunction (vtkSmartPointer< vtkColorTransferFunction > _arg)
 
virtual const HistogramGenerator::HistogramTypeGetHistogram ()
 Get histogram used for transfer function initialization. More...
 
void InitializeByMitkImage (const mitk::Image *image)
 Initialize transfer function based on the histogram of an mitk::Image. More...
 
void InitializeByItkHistogram (const itk::Statistics::Histogram< double > *histogram)
 Initialize transfer function based on the specified histogram. More...
 
void InitializeHistogram (const mitk::Image *image)
 Initialize the internal histogram and min/max range based on the specified mitk::Image. More...
 
void SetScalarOpacityPoints (TransferFunction::ControlPoints points)
 Insert control points and values into the scalar opacity transfer function. More...
 
void SetGradientOpacityPoints (TransferFunction::ControlPoints points)
 Insert control points and values into the gradient opacity transfer function. More...
 
void SetRGBPoints (TransferFunction::RGBControlPoints rgbpoints)
 Insert control points and RGB values into the color transfer function. More...
 
void AddScalarOpacityPoint (double x, double value)
 Add a single control point to the scalar opacity transfer function. More...
 
void AddGradientOpacityPoint (double x, double value)
 Add a single control point to the gradient opacity transfer function. More...
 
void AddRGBPoint (double x, double r, double g, double b)
 Add a single control point to the color opacity transfer function. More...
 
TransferFunction::ControlPointsGetScalarOpacityPoints ()
 Get a copy of the scalar opacity transfer function control-points. More...
 
TransferFunction::ControlPointsGetGradientOpacityPoints ()
 Get a copy of the gradient opacity transfer function control-points. More...
 
TransferFunction::RGBControlPointsGetRGBPoints ()
 Get a copy of the color transfer function control-points. More...
 
int RemoveScalarOpacityPoint (double x)
 Remove the specified control point from the scalar opacity transfer function. More...
 
int RemoveGradientOpacityPoint (double x)
 Remove the specified control point from the gradient opacity transfer function. More...
 
int RemoveRGBPoint (double x)
 Remove the specified control point from the color transfer function. More...
 
void ClearScalarOpacityPoints ()
 Removes all control points from the scalar opacity transfer function. More...
 
void ClearGradientOpacityPoints ()
 Removes all control points from the gradient opacity transfer function. More...
 
void ClearRGBPoints ()
 Removes all control points from the color transfer function. More...
 
bool operator== (Self &other)
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 

Protected Member Functions

 TransferFunction ()
 
 ~TransferFunction () override
 
 TransferFunction (const TransferFunction &other)
 
itk::LightObject::Pointer InternalClone () const override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 

Protected Attributes

vtkSmartPointer< vtkPiecewiseFunction > m_ScalarOpacityFunction
 
vtkSmartPointer< vtkPiecewiseFunction > m_GradientOpacityFunction
 
vtkSmartPointer< vtkColorTransferFunction > m_ColorTransferFunction
 
int m_Min
 
int m_Max
 
mitk::HistogramGenerator::HistogramType::ConstPointer m_Histogram
 

Detailed Description

The TransferFunction class A wrapper class for VTK scalar opacity, gradient opacity, and color transfer functions.

Holds a copy of each of the three standard VTK transfer functions (scalar opacity, gradient opacity, color) and provides an interface for manipulating their control points. Each original function can be retrieved by a Get() method.

Note
Currently, transfer function initialization based on histograms or computed-tomography-presets is also provided by this class, but will likely be separated into a specific initializer class.
If you want to use this as a property for an mitk::Image, make sure to use the mitk::TransferFunctionProperty and set the mitk::RenderingModeProperty to a mode which supports transfer functions (e.g. COLORTRANSFERFUNCTION_COLOR). Make sure to check the documentation of the mitk::RenderingModeProperty. For a code example how to use the mitk::TransferFunction check the mitkImageVtkMapper2DTransferFunctionTest.cpp in Core/Code/Testing.

Definition at line 55 of file mitkTransferFunction.h.

Member Typedef Documentation

◆ ConstPointer

◆ ControlPoints

typedef std::vector<std::pair<double, double> > mitk::TransferFunction::ControlPoints

Definition at line 58 of file mitkTransferFunction.h.

◆ Pointer

◆ RGBControlPoints

typedef std::vector<std::pair<double, itk::RGBPixel<double> > > mitk::TransferFunction::RGBControlPoints

Definition at line 59 of file mitkTransferFunction.h.

◆ Self

◆ Superclass

typedef itk::DataObject mitk::TransferFunction::Superclass

Definition at line 61 of file mitkTransferFunction.h.

Constructor & Destructor Documentation

◆ TransferFunction() [1/2]

mitk::TransferFunction::TransferFunction ( )
protected

◆ ~TransferFunction()

mitk::TransferFunction::~TransferFunction ( )
overrideprotected

◆ TransferFunction() [2/2]

mitk::TransferFunction::TransferFunction ( const TransferFunction other)
protected

Member Function Documentation

◆ AddGradientOpacityPoint()

void mitk::TransferFunction::AddGradientOpacityPoint ( double  x,
double  value 
)

Add a single control point to the gradient opacity transfer function.

◆ AddRGBPoint()

void mitk::TransferFunction::AddRGBPoint ( double  x,
double  r,
double  g,
double  b 
)

Add a single control point to the color opacity transfer function.

◆ AddScalarOpacityPoint()

void mitk::TransferFunction::AddScalarOpacityPoint ( double  x,
double  value 
)

Add a single control point to the scalar opacity transfer function.

◆ ClearGradientOpacityPoints()

void mitk::TransferFunction::ClearGradientOpacityPoints ( )

Removes all control points from the gradient opacity transfer function.

◆ ClearRGBPoints()

void mitk::TransferFunction::ClearRGBPoints ( )

Removes all control points from the color transfer function.

◆ ClearScalarOpacityPoints()

void mitk::TransferFunction::ClearScalarOpacityPoints ( )

Removes all control points from the scalar opacity transfer function.

◆ Clone()

Pointer mitk::TransferFunction::Clone ( ) const

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::TransferFunction::GetClassHierarchy ( ) const
inlinevirtual

Definition at line 61 of file mitkTransferFunction.h.

◆ GetClassName()

virtual const char* mitk::TransferFunction::GetClassName ( ) const
virtual

◆ GetColorTransferFunction()

virtual vtkColorTransferFunction* mitk::TransferFunction::GetColorTransferFunction ( )
virtual

Get/Set wrapped vtk transfer function.

◆ GetGradientOpacityFunction()

virtual vtkPiecewiseFunction* mitk::TransferFunction::GetGradientOpacityFunction ( )
virtual

Get/Set wrapped vtk transfer function.

◆ GetGradientOpacityPoints()

TransferFunction::ControlPoints& mitk::TransferFunction::GetGradientOpacityPoints ( )

Get a copy of the gradient opacity transfer function control-points.

◆ GetHistogram()

virtual const HistogramGenerator::HistogramType* mitk::TransferFunction::GetHistogram ( )
virtual

Get histogram used for transfer function initialization.

◆ GetMax()

virtual int mitk::TransferFunction::GetMax ( )
virtual

Get/Set min/max of transfer function range for initialization.

◆ GetMin()

virtual int mitk::TransferFunction::GetMin ( )
virtual

Get/Set min/max of transfer function range for initialization.

◆ GetRGBPoints()

TransferFunction::RGBControlPoints& mitk::TransferFunction::GetRGBPoints ( )

Get a copy of the color transfer function control-points.

◆ GetScalarOpacityFunction()

virtual vtkPiecewiseFunction* mitk::TransferFunction::GetScalarOpacityFunction ( )
virtual

Get/Set wrapped vtk transfer function.

◆ GetScalarOpacityPoints()

TransferFunction::ControlPoints& mitk::TransferFunction::GetScalarOpacityPoints ( )

Get a copy of the scalar opacity transfer function control-points.

◆ GetStaticNameOfClass()

static const char* mitk::TransferFunction::GetStaticNameOfClass ( )
inlinestatic

Definition at line 61 of file mitkTransferFunction.h.

◆ InitializeByItkHistogram()

void mitk::TransferFunction::InitializeByItkHistogram ( const itk::Statistics::Histogram< double > *  histogram)

Initialize transfer function based on the specified histogram.

◆ InitializeByMitkImage()

void mitk::TransferFunction::InitializeByMitkImage ( const mitk::Image image)

Initialize transfer function based on the histogram of an mitk::Image.

◆ InitializeHistogram()

void mitk::TransferFunction::InitializeHistogram ( const mitk::Image image)

Initialize the internal histogram and min/max range based on the specified mitk::Image.

◆ InternalClone()

itk::LightObject::Pointer mitk::TransferFunction::InternalClone ( ) const
overrideprotected

◆ New()

static Pointer mitk::TransferFunction::New ( )
static

◆ operator==()

bool mitk::TransferFunction::operator== ( Self other)

◆ PrintSelf()

void mitk::TransferFunction::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ RemoveGradientOpacityPoint()

int mitk::TransferFunction::RemoveGradientOpacityPoint ( double  x)

Remove the specified control point from the gradient opacity transfer function.

◆ RemoveRGBPoint()

int mitk::TransferFunction::RemoveRGBPoint ( double  x)

Remove the specified control point from the color transfer function.

◆ RemoveScalarOpacityPoint()

int mitk::TransferFunction::RemoveScalarOpacityPoint ( double  x)

Remove the specified control point from the scalar opacity transfer function.

◆ SetColorTransferFunction()

virtual void mitk::TransferFunction::SetColorTransferFunction ( vtkSmartPointer< vtkColorTransferFunction >  _arg)
virtual

◆ SetGradientOpacityPoints()

void mitk::TransferFunction::SetGradientOpacityPoints ( TransferFunction::ControlPoints  points)

Insert control points and values into the gradient opacity transfer function.

◆ SetMax()

virtual void mitk::TransferFunction::SetMax ( int  _arg)
virtual

Get/Set min/max of transfer function range for initialization.

◆ SetMin()

virtual void mitk::TransferFunction::SetMin ( int  _arg)
virtual

Get/Set min/max of transfer function range for initialization.

◆ SetRGBPoints()

void mitk::TransferFunction::SetRGBPoints ( TransferFunction::RGBControlPoints  rgbpoints)

Insert control points and RGB values into the color transfer function.

◆ SetScalarOpacityPoints()

void mitk::TransferFunction::SetScalarOpacityPoints ( TransferFunction::ControlPoints  points)

Insert control points and values into the scalar opacity transfer function.

Member Data Documentation

◆ m_ColorTransferFunction

vtkSmartPointer<vtkColorTransferFunction> mitk::TransferFunction::m_ColorTransferFunction
protected

Wrapped VTK color transfer function

Definition at line 172 of file mitkTransferFunction.h.

◆ m_GradientOpacityFunction

vtkSmartPointer<vtkPiecewiseFunction> mitk::TransferFunction::m_GradientOpacityFunction
protected

Wrapped VTK gradient opacity transfer function

Definition at line 169 of file mitkTransferFunction.h.

◆ m_Histogram

mitk::HistogramGenerator::HistogramType::ConstPointer mitk::TransferFunction::m_Histogram
protected

Specified or calculated histogram (used for initialization)

Definition at line 181 of file mitkTransferFunction.h.

◆ m_Max

int mitk::TransferFunction::m_Max
protected

Current range of transfer function (used for initialization)

Definition at line 178 of file mitkTransferFunction.h.

◆ m_Min

int mitk::TransferFunction::m_Min
protected

Current range of transfer function (used for initialization)

Definition at line 175 of file mitkTransferFunction.h.

◆ m_ScalarOpacityFunction

vtkSmartPointer<vtkPiecewiseFunction> mitk::TransferFunction::m_ScalarOpacityFunction
protected

Wrapped VTK scalar opacity transfer function

Definition at line 166 of file mitkTransferFunction.h.


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