13 #ifndef mitkTransferFunction_h
14 #define mitkTransferFunction_h
20 #include <itkHistogram.h>
21 #include <itkObject.h>
22 #include <itkRGBPixel.h>
24 #include <vtkColorTransferFunction.h>
25 #include <vtkPiecewiseFunction.h>
26 #include <vtkSmartPointer.h>
60 itkFactorylessNewMacro(Self);
65 itkSetMacro(Min,
int);
68 itkSetMacro(Max,
int);
71 itkGetMacro(Min,
int);
74 itkGetMacro(Max,
int);
77 itkGetMacro(ScalarOpacityFunction, vtkPiecewiseFunction *);
80 itkGetMacro(GradientOpacityFunction, vtkPiecewiseFunction *);
83 itkGetMacro(ColorTransferFunction, vtkColorTransferFunction *);
211 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
229 mitk::HistogramGenerator::HistogramType::ConstPointer
m_Histogram;
itk::Statistics::Histogram< double > HistogramType
Image class for storing multi-dimensional medical image data.
Wrapper for VTK scalar opacity, gradient opacity, and color transfer functions.
int RemoveRGBPoint(double x)
Remove a control point from the color transfer function.
void SetScalarOpacityPoints(TransferFunction::ControlPoints points)
Replace all scalar opacity control points.
void ClearGradientOpacityPoints()
Remove all control points from the gradient opacity function.
mitk::HistogramGenerator::HistogramType::ConstPointer m_Histogram
TransferFunction::RGBControlPoints & GetRGBPoints()
Get the color transfer function control points.
void InitializeByMitkImage(const mitk::Image *image)
Initialize all three transfer functions from an mitk::Image histogram.
int RemoveGradientOpacityPoint(double x)
Remove a control point from the gradient opacity function.
TransferFunction::ControlPoints & GetGradientOpacityPoints()
Get the gradient opacity control points.
std::vector< std::pair< double, itk::RGBPixel< double > > > RGBControlPoints
Type for color transfer function control points (x, RGB).
void ClearScalarOpacityPoints()
Remove all control points from the scalar opacity function.
std::vector< std::pair< double, double > > ControlPoints
Type for scalar opacity or gradient opacity control points (x, value).
vtkSmartPointer< vtkPiecewiseFunction > m_GradientOpacityFunction
~TransferFunction() override
void SetRGBPoints(TransferFunction::RGBControlPoints rgbpoints)
Replace all color transfer function control points.
int RemoveScalarOpacityPoint(double x)
Remove a control point from the scalar opacity function.
void SetGradientOpacityPoints(TransferFunction::ControlPoints points)
Replace all gradient opacity control points.
TransferFunction(const Self &other)
void AddGradientOpacityPoint(double x, double value)
Add a single control point to the gradient opacity function.
TransferFunction::ControlPoints & GetScalarOpacityPoints()
Get the scalar opacity control points.
mitkClassMacroItkParent(TransferFunction, itk::DataObject)
void AddScalarOpacityPoint(double x, double value)
Add a single control point to the scalar opacity function.
void AddRGBPoint(double x, double r, double g, double b)
Add a single control point to the color transfer function.
void InitializeHistogram(const mitk::Image *image)
Compute and store the histogram and min/max range from an image.
void ClearRGBPoints()
Remove all control points from the color transfer function.
void InitializeByItkHistogram(const itk::Statistics::Histogram< double > *histogram)
Initialize all three transfer functions from an ITK histogram.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
vtkSmartPointer< vtkColorTransferFunction > m_ColorTransferFunction
bool operator==(Self &other)
Compare two TransferFunction objects for equality.
vtkSmartPointer< vtkPiecewiseFunction > m_ScalarOpacityFunction
Find image slices visible on a given plane.