[vtkusers] Confusion with vtkColorTransferFunction and vtkPiecewiseFunction

Chasan KIOUTSOUKMOUSTAFA chasank at gmail.com
Fri May 6 02:33:15 EDT 2011


I have a pipeline that does volume rendering from DICOM datasets. I'm using
vtkColorTransferFunction and vtkPiecewiseFunction classes.
at vtkColorTransferFunctions's
documentation<http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html#aa3bd656f032908593e89f749796ed786>first
parameter of AddRGBPoint method is double x which is not mentioned
what exactly it is?
Is it Hounsfeild Unit ?
Same deficient documentation<http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html#a5196b67dda9f5ba027797176e4d566a0>does
not tell anything to me. Okay, second parameter is the opacity value
that might change 0.0 to 1.0
What about the first parameter ( double x) Is it again Hounsfeild Unit ?
Thanks for help from now..

volumeColor = vtkSmartPointer<vtkColorTransferFunction>::New();
    volumeColor->AddRGBPoint(0,    0.0, 0.0, 0.0);
    volumeColor->AddRGBPoint(500,  1.0, 0.5, 0.3);
    volumeColor->AddRGBPoint(1000, 1.0, 0.5, 0.3);
    volumeColor->AddRGBPoint(1150, 1.0, 1.0, 0.9);

    volumeScalarOpacity =  vtkSmartPointer<vtkPiecewiseFunction>::New();
    volumeScalarOpacity->AddPoint(0,    0.00);
    volumeScalarOpacity->AddPoint(500,  0.15);
    volumeScalarOpacity->AddPoint(1000, 0.15);
    volumeScalarOpacity->AddPoint(1150, 0.90);

    volumeGradientOpacity = vtkSmartPointer<vtkPiecewiseFunction>::New();
    volumeGradientOpacity->AddPoint(0,   0.0);
    volumeGradientOpacity->AddPoint(90,  0.5);
    volumeGradientOpacity->AddPoint(100, 1.0);

-- 
Chasan KIOUTSOUKMOUSTAFA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110506/8f1fd281/attachment.htm>


More information about the vtkusers mailing list