[vtkusers] Confusion with vtkColorTransferFunction and vtkPiecewiseFunction

Jason K Wang jkwang01 at syr.edu
Sat May 7 23:40:08 EDT 2011


Chasan,

I'm no expert, but, I'm working with VTK for my major student project and I think your "double x" would be the pixel intensity values (which for MRI images can vary, but, from what I've seen is relatively well-defined for CT images). I'm pretty sure pixel intensity values can be measured directly using a program such as ImageJ. I think for CT images, the "double x" is directly proportionally to the Hounsfield unit (HU), but, I might be wrong, I don't think it's exactly the HU.

Jason,

________________________________________
Message: 10
Date: Fri, 6 May 2011 09:33:15 +0300
From: Chasan KIOUTSOUKMOUSTAFA <chasank at gmail.com>
Subject: [vtkusers] Confusion with vtkColorTransferFunction and
        vtkPiecewiseFunction
To: vtkusers at vtk.org
Message-ID: <BANLkTinV33A9qcqiA3i6icpeEAp8p=Kapg at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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);


More information about the vtkusers mailing list