Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
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>
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< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
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::HistogramType * | GetHistogram () |
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::ControlPoints & | GetScalarOpacityPoints () |
Get a copy of the scalar opacity transfer function control-points. More... | |
TransferFunction::ControlPoints & | GetGradientOpacityPoints () |
Get a copy of the gradient opacity transfer function control-points. More... | |
TransferFunction::RGBControlPoints & | GetRGBPoints () |
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 () | |
virtual | ~TransferFunction () |
TransferFunction (const TransferFunction &other) | |
virtual 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 |
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.
Definition at line 59 of file mitkTransferFunction.h.
typedef itk::SmartPointer<const Self> mitk::TransferFunction::ConstPointer |
Definition at line 65 of file mitkTransferFunction.h.
typedef std::vector<std::pair<double, double> > mitk::TransferFunction::ControlPoints |
Definition at line 62 of file mitkTransferFunction.h.
Definition at line 65 of file mitkTransferFunction.h.
typedef std::vector<std::pair<double, itk::RGBPixel<double> > > mitk::TransferFunction::RGBControlPoints |
Definition at line 63 of file mitkTransferFunction.h.
Definition at line 65 of file mitkTransferFunction.h.
typedef itk::DataObject mitk::TransferFunction::Superclass |
Definition at line 65 of file mitkTransferFunction.h.
|
protected |
Definition at line 27 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction, m_GradientOpacityFunction, m_ScalarOpacityFunction, and mitk::New().
|
protectedvirtual |
Definition at line 61 of file mitkTransferFunction.cpp.
|
protected |
Definition at line 44 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction, m_GradientOpacityFunction, and m_ScalarOpacityFunction.
void mitk::TransferFunction::AddGradientOpacityPoint | ( | double | x, |
double | value | ||
) |
Add a single control point to the gradient opacity transfer function.
Definition at line 141 of file mitkTransferFunction.cpp.
References m_GradientOpacityFunction.
Referenced by SetGradientOpacityPoints().
void mitk::TransferFunction::AddRGBPoint | ( | double | x, |
double | r, | ||
double | g, | ||
double | b | ||
) |
Add a single control point to the color opacity transfer function.
Definition at line 146 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction.
Referenced by SetRGBPoints().
void mitk::TransferFunction::AddScalarOpacityPoint | ( | double | x, |
double | value | ||
) |
Add a single control point to the scalar opacity transfer function.
Definition at line 140 of file mitkTransferFunction.cpp.
References m_ScalarOpacityFunction.
Referenced by SetScalarOpacityPoints().
void mitk::TransferFunction::ClearGradientOpacityPoints | ( | ) |
Removes all control points from the gradient opacity transfer function.
Definition at line 195 of file mitkTransferFunction.cpp.
References m_GradientOpacityFunction.
void mitk::TransferFunction::ClearRGBPoints | ( | ) |
Removes all control points from the color transfer function.
Definition at line 196 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction.
void mitk::TransferFunction::ClearScalarOpacityPoints | ( | ) |
Removes all control points from the scalar opacity transfer function.
Definition at line 194 of file mitkTransferFunction.cpp.
References m_ScalarOpacityFunction.
Pointer mitk::TransferFunction::Clone | ( | ) | const |
|
inlinevirtual |
Definition at line 65 of file mitkTransferFunction.h.
|
virtual |
|
virtual |
Get/Set wrapped vtk transfer function.
Referenced by mitk::TransferFunctionPropertySerializer::Serialize().
|
virtual |
Get/Set wrapped vtk transfer function.
TransferFunction::ControlPoints & mitk::TransferFunction::GetGradientOpacityPoints | ( | ) |
Get a copy of the gradient opacity transfer function control-points.
Definition at line 164 of file mitkTransferFunction.cpp.
References m_GradientOpacityFunction.
Referenced by mitk::TransferFunctionPropertySerializer::Serialize().
|
virtual |
Get histogram used for transfer function initialization.
Referenced by InitializeByItkHistogram(), InitializeByMitkImage(), and InitializeHistogram().
|
virtual |
Get/Set min/max of transfer function range for initialization.
|
virtual |
Get/Set min/max of transfer function range for initialization.
TransferFunction::RGBControlPoints & mitk::TransferFunction::GetRGBPoints | ( | ) |
Get a copy of the color transfer function control-points.
Definition at line 177 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction.
|
virtual |
Get/Set wrapped vtk transfer function.
TransferFunction::ControlPoints & mitk::TransferFunction::GetScalarOpacityPoints | ( | ) |
Get a copy of the scalar opacity transfer function control-points.
Definition at line 151 of file mitkTransferFunction.cpp.
References m_ScalarOpacityFunction.
Referenced by mitk::TransferFunctionPropertySerializer::Serialize().
|
inlinestatic |
Definition at line 65 of file mitkTransferFunction.h.
void mitk::TransferFunction::InitializeByItkHistogram | ( | const itk::Statistics::Histogram< double > * | histogram | ) |
Initialize transfer function based on the specified histogram.
Definition at line 197 of file mitkTransferFunction.cpp.
References GetHistogram(), m_Histogram, m_Max, and m_Min.
void mitk::TransferFunction::InitializeByMitkImage | ( | const mitk::Image * | image | ) |
Initialize transfer function based on the histogram of an mitk::Image.
Definition at line 223 of file mitkTransferFunction.cpp.
References GetHistogram(), m_ColorTransferFunction, m_GradientOpacityFunction, m_Histogram, m_Max, m_Min, m_ScalarOpacityFunction, and mitk::HistogramGenerator::New().
void mitk::TransferFunction::InitializeHistogram | ( | const mitk::Image * | image | ) |
Initialize the internal histogram and min/max range based on the specified mitk::Image.
Definition at line 250 of file mitkTransferFunction.cpp.
References GetHistogram(), m_Histogram, m_Max, m_Min, and mitk::HistogramGenerator::New().
|
overrideprotectedvirtual |
Definition at line 272 of file mitkTransferFunction.cpp.
|
static |
Referenced by mitk::ConfigureNodeAsDoseNode(), mitk::TransferFunctionPropertySerializer::Deserialize(), main(), mitkImageVtkMapper2DOpacityTransferFunctionTest(), mitkImageVtkMapper2DTransferFunctionTest(), mitkPropertyTest(), mitkTransferFunctionTest(), mitk::UnstructuredGridVtkMapper3D::SetDefaultProperties(), and mitk::GPUVolumeMapper3D::SetDefaultProperties().
bool mitk::TransferFunction::operator== | ( | Self & | other | ) |
Definition at line 62 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction, m_GradientOpacityFunction, m_Max, m_Min, and m_ScalarOpacityFunction.
|
overrideprotected |
Definition at line 261 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction, m_GradientOpacityFunction, m_Max, m_Min, and m_ScalarOpacityFunction.
int mitk::TransferFunction::RemoveGradientOpacityPoint | ( | double | x | ) |
Remove the specified control point from the gradient opacity transfer function.
Definition at line 192 of file mitkTransferFunction.cpp.
References m_GradientOpacityFunction.
int mitk::TransferFunction::RemoveRGBPoint | ( | double | x | ) |
Remove the specified control point from the color transfer function.
Definition at line 193 of file mitkTransferFunction.cpp.
References m_ColorTransferFunction.
int mitk::TransferFunction::RemoveScalarOpacityPoint | ( | double | x | ) |
Remove the specified control point from the scalar opacity transfer function.
Definition at line 191 of file mitkTransferFunction.cpp.
References m_ScalarOpacityFunction.
|
virtual |
void mitk::TransferFunction::SetGradientOpacityPoints | ( | TransferFunction::ControlPoints | points | ) |
Insert control points and values into the gradient opacity transfer function.
Definition at line 122 of file mitkTransferFunction.cpp.
References AddGradientOpacityPoint(), and m_GradientOpacityFunction.
|
virtual |
Get/Set min/max of transfer function range for initialization.
|
virtual |
Get/Set min/max of transfer function range for initialization.
void mitk::TransferFunction::SetRGBPoints | ( | TransferFunction::RGBControlPoints | rgbpoints | ) |
Insert control points and RGB values into the color transfer function.
Definition at line 131 of file mitkTransferFunction.cpp.
References AddRGBPoint(), and m_ColorTransferFunction.
void mitk::TransferFunction::SetScalarOpacityPoints | ( | TransferFunction::ControlPoints | points | ) |
Insert control points and values into the scalar opacity transfer function.
Definition at line 113 of file mitkTransferFunction.cpp.
References AddScalarOpacityPoint(), and m_ScalarOpacityFunction.
|
protected |
Wrapped VTK color transfer function
Definition at line 174 of file mitkTransferFunction.h.
Referenced by AddRGBPoint(), ClearRGBPoints(), GetRGBPoints(), InitializeByMitkImage(), operator==(), PrintSelf(), RemoveRGBPoint(), SetRGBPoints(), and TransferFunction().
|
protected |
Wrapped VTK gradient opacity transfer function
Definition at line 171 of file mitkTransferFunction.h.
Referenced by AddGradientOpacityPoint(), ClearGradientOpacityPoints(), GetGradientOpacityPoints(), InitializeByMitkImage(), operator==(), PrintSelf(), RemoveGradientOpacityPoint(), SetGradientOpacityPoints(), and TransferFunction().
|
protected |
Specified or calculated histogram (used for initialization)
Definition at line 183 of file mitkTransferFunction.h.
Referenced by InitializeByItkHistogram(), InitializeByMitkImage(), and InitializeHistogram().
|
protected |
Current range of transfer function (used for initialization)
Definition at line 180 of file mitkTransferFunction.h.
Referenced by InitializeByItkHistogram(), InitializeByMitkImage(), InitializeHistogram(), operator==(), and PrintSelf().
|
protected |
Current range of transfer function (used for initialization)
Definition at line 177 of file mitkTransferFunction.h.
Referenced by InitializeByItkHistogram(), InitializeByMitkImage(), InitializeHistogram(), operator==(), and PrintSelf().
|
protected |
Wrapped VTK scalar opacity transfer function
Definition at line 168 of file mitkTransferFunction.h.
Referenced by AddScalarOpacityPoint(), ClearScalarOpacityPoints(), GetScalarOpacityPoints(), InitializeByMitkImage(), operator==(), PrintSelf(), RemoveScalarOpacityPoint(), SetScalarOpacityPoints(), and TransferFunction().