17 #include <itkRGBPixel.h> 48 m_ScalarOpacityPoints(other.m_ScalarOpacityPoints),
49 m_GradientOpacityPoints(other.m_GradientOpacityPoints),
50 m_RGBPoints(other.m_RGBPoints)
75 bool equal = (myVal[0] == otherVal[0]) && (myVal[1] == otherVal[1]) && (myVal[2] == otherVal[2]) &&
76 (myVal[3] == otherVal[3]);
86 bool equal = (myVal[0] == otherVal[0]) && (myVal[1] == otherVal[1]) && (myVal[2] == otherVal[2]) &&
87 (myVal[3] == otherVal[3]);
97 bool equal = (myVal[0] == otherVal[0])
98 && (myVal[1] == otherVal[1])
99 && (myVal[2] == otherVal[2])
100 && (myVal[3] == otherVal[3])
101 && (myVal[4] == otherVal[4])
102 && (myVal[5] == otherVal[5]);
112 for (
unsigned int i = 0; i <= points.size() - 1; i++)
121 for (
unsigned int i = 0; i <= points.size() - 1; i++)
130 for (
unsigned int i = 0; i <= rgbpoints.size() - 1; i++)
132 this->
AddRGBPoint(rgbpoints[i].first, rgbpoints[i].second[0], rgbpoints[i].second[1], rgbpoints[i].second[2]);
150 m_ScalarOpacityPoints.clear();
154 m_ScalarOpacityPoints.push_back(std::make_pair(data[i * 2], data[i * 2 + 1]));
157 return m_ScalarOpacityPoints;
163 m_GradientOpacityPoints.clear();
167 m_GradientOpacityPoints.push_back(std::make_pair(data[i * 2], data[i * 2 + 1]));
170 return m_GradientOpacityPoints;
180 double rgb[] = {data[i * 4 + 1], data[i * 4 + 2], data[i * 4 + 3]};
181 m_RGBPoints.push_back(std::make_pair(data[i * 4], rgb));
222 histGen->SetImage(image);
223 histGen->SetSize(256);
224 histGen->ComputeHistogram();
249 histGen->SetImage(image);
250 histGen->SetSize(256);
251 histGen->ComputeHistogram();
259 os << indent <<
"ScalarOpacity: ";
261 os << indent <<
"GradientOpacity: ";
263 os << indent <<
"ColorTransfer: ";
265 os << indent <<
"Min: " <<
m_Min <<
", Max: " <<
m_Max << std::endl;
270 itk::LightObject::Pointer result(
new Self(*
this));
271 result->UnRegister();
void InitializeByMitkImage(const mitk::Image *image)
Initialize transfer function based on the histogram of an mitk::Image.
void ClearGradientOpacityPoints()
Removes all control points from the gradient opacity transfer function.
vtkSmartPointer< vtkColorTransferFunction > m_ColorTransferFunction
void SetGradientOpacityPoints(TransferFunction::ControlPoints points)
Insert control points and values into the gradient opacity transfer function.
itk::LightObject::Pointer InternalClone() const override
TransferFunction::RGBControlPoints & GetRGBPoints()
Get a copy of the color transfer function control-points.
vtkSmartPointer< vtkPiecewiseFunction > m_GradientOpacityFunction
void InitializeByItkHistogram(const itk::Statistics::Histogram< double > *histogram)
Initialize transfer function based on the specified 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.
DataCollection - Class to facilitate loading/accessing structured data.
void ClearScalarOpacityPoints()
Removes all control points from the scalar opacity transfer function.
void SetScalarOpacityPoints(TransferFunction::ControlPoints points)
Insert control points and values into the scalar opacity transfer function.
std::vector< std::pair< double, itk::RGBPixel< double > > > RGBControlPoints
void AddRGBPoint(double x, double r, double g, double b)
Add a single control point to the color opacity transfer function.
int RemoveScalarOpacityPoint(double x)
Remove the specified control point from the scalar opacity transfer function.
void SetRGBPoints(TransferFunction::RGBControlPoints rgbpoints)
Insert control points and RGB values into the color transfer function.
mitk::HistogramGenerator::HistogramType::ConstPointer m_Histogram
TransferFunction::ControlPoints & GetScalarOpacityPoints()
Get a copy of the scalar opacity transfer function control-points.
void ClearRGBPoints()
Removes all control points from the color transfer function.
~TransferFunction() override
Image class for storing images.
vtkSmartPointer< vtkPiecewiseFunction > m_ScalarOpacityFunction
int RemoveRGBPoint(double x)
Remove the specified control point from the color transfer function.
mitk::Image::Pointer image
bool operator==(Self &other)
void InitializeHistogram(const mitk::Image *image)
Initialize the internal histogram and min/max range based on the specified mitk::Image.
std::vector< std::pair< double, double > > ControlPoints
TransferFunction::ControlPoints & GetGradientOpacityPoints()
Get a copy of the gradient opacity transfer function control-points.
void AddScalarOpacityPoint(double x, double value)
Add a single control point to the scalar opacity transfer function.
virtual const HistogramGenerator::HistogramType * GetHistogram()
Get histogram used for transfer function initialization.
void AddGradientOpacityPoint(double x, double value)
Add a single control point to the gradient opacity transfer function.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
int RemoveGradientOpacityPoint(double x)
Remove the specified control point from the gradient opacity transfer function.