22 #include <QDomDocument> 23 #include <vtkLookupTable.h> 24 #include <vtkImageData.h> 25 #include <vtkColorTransferFunction.h> 26 #include <vtkPiecewiseFunction.h> 76 retval->deepCopy(
this);
82 double smin = image->GetScalarRange()[0];
83 double smax = image->GetScalarRange()[1];
84 double srange = smax - smin;
93 mOutputLUT = vtkLookupTablePtr::New();
94 this->refreshOutputLUT();
115 this->refreshOutputLUT();
119 std::pair<int,int> ImageLUT2D::getMapsRange()
125 return std::make_pair(imin,imax);
131 return std::make_pair(imin,imax);
137 return std::make_pair(imin,imax);
141 return std::make_pair(0,0);
145 void ImageLUT2D::refreshOutputLUT()
150 std::pair<int,int> range = this->getMapsRange();
151 int imin = range.first;
152 int imax = range.second;
155 int icount = imax - imin + 1;
159 lut->SetNumberOfTableValues(icount);
160 lut->SetTableRange(imin, imax);
165 for (
int i = 0; i < icount; ++i)
167 double* rgb = colorFunc->GetColor(i + imin);
168 double alpha = opacityFunc->GetValue(i + imin);
169 lut->SetTableValue(i, rgb[0], rgb[1], rgb[2], alpha);
173 lut->GetTable()->Modified();
181 unsigned char input = 0;
182 lut->MapScalarsThroughTable2(&input, &input, VTK_UNSIGNED_CHAR, 1, 1, 1);
void transferFunctionsChanged()
ImageLUT2DPtr createCopy()
void setFullRangeWinLevel(vtkImageDataPtr image)
Set winlevel spanning the entire range.
vtkColorTransferFunctionPtr generateColorTF() const
vtkSmartPointer< class vtkPiecewiseFunction > vtkPiecewiseFunctionPtr
vtkSmartPointer< class vtkColorTransferFunction > vtkColorTransferFunctionPtr
virtual void internalsHaveChanged()
boost::shared_ptr< class ImageLUT2D > ImageLUT2DPtr
void setWindow(double val)
range [1..scalarMax-scalarMin]
vtkPiecewiseFunctionPtr generateOpacityTF() const
vtkSmartPointer< class vtkLookupTable > vtkLookupTablePtr
void setLevel(double val)
range [scalarMin..scalarMax]
vtkLookupTablePtr getOutputLookupTable()
Namespace for all CustusX production code.