21 #include <itkRGBPixel.h>
46 m_ScalarOpacityFunction(other.m_ScalarOpacityFunction.
New()),
47 m_GradientOpacityFunction(other.m_GradientOpacityFunction.
New()),
48 m_ColorTransferFunction(other.m_ColorTransferFunction.
New()),
51 m_Histogram(other.m_Histogram),
52 m_ScalarOpacityPoints(other.m_ScalarOpacityPoints),
53 m_GradientOpacityPoints(other.m_GradientOpacityPoints),
54 m_RGBPoints(other.m_RGBPoints)
79 bool equal = (myVal[0] == otherVal[0]) && (myVal[1] == otherVal[1]) && (myVal[2] == otherVal[2]) &&
80 (myVal[3] == otherVal[3]);
90 bool equal = (myVal[0] == otherVal[0]) && (myVal[1] == otherVal[1]) && (myVal[2] == otherVal[2]) &&
91 (myVal[3] == otherVal[3]);
101 bool equal = (myVal[0] == otherVal[0])
102 && (myVal[1] == otherVal[1])
103 && (myVal[2] == otherVal[2])
104 && (myVal[3] == otherVal[3])
105 && (myVal[4] == otherVal[4])
106 && (myVal[5] == otherVal[5]);
116 for (
unsigned int i = 0; i <= points.size() - 1; i++)
125 for (
unsigned int i = 0; i <= points.size() - 1; i++)
134 for (
unsigned int i = 0; i <= rgbpoints.size() - 1; i++)
136 this->
AddRGBPoint(rgbpoints[i].first, rgbpoints[i].second[0], rgbpoints[i].second[1], rgbpoints[i].second[2]);
154 m_ScalarOpacityPoints.clear();
158 m_ScalarOpacityPoints.push_back(std::make_pair(data[i * 2], data[i * 2 + 1]));
161 return m_ScalarOpacityPoints;
167 m_GradientOpacityPoints.clear();
171 m_GradientOpacityPoints.push_back(std::make_pair(data[i * 2], data[i * 2 + 1]));
174 return m_GradientOpacityPoints;
184 double rgb[] = {data[i * 4 + 1], data[i * 4 + 2], data[i * 4 + 3]};
185 m_RGBPoints.push_back(std::make_pair(data[i * 4], rgb));
226 histGen->SetImage(image);
227 histGen->SetSize(256);
228 histGen->ComputeHistogram();
253 histGen->SetImage(image);
254 histGen->SetSize(256);
255 histGen->ComputeHistogram();
263 os << indent <<
"ScalarOpacity: ";
265 os << indent <<
"GradientOpacity: ";
267 os << indent <<
"ColorTransfer: ";
269 os << indent <<
"Min: " <<
m_Min <<
", Max: " <<
m_Max << std::endl;
275 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::SmartPointer< Self > Pointer
virtual 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.
Image class for storing images.
vtkSmartPointer< vtkPiecewiseFunction > m_ScalarOpacityFunction
int RemoveRGBPoint(double x)
Remove the specified control point from the color transfer function.
bool operator==(Self &other)
void InitializeHistogram(const mitk::Image *image)
Initialize the internal histogram and min/max range based on the specified mitk::Image.
virtual ~TransferFunction()
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.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.