[vtkusers] A question about displaying Image using VTK

15891495523 at 126.com 15891495523 at 126.com
Thu Jul 9 10:51:11 EDT 2015


Dear all 

    I feel confused when display a CT image using VTK. How can I make those black and gray part in the following picture invisible ? 
    The key part of my code is : 

vtkSmartPointer<vtkPiecewiseFunction> opacityTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New(); 
        opacityTransferFunction->AddPoint(0,1200); 
        opacityTransferFunction->AddPoint(1200,0.4); 
        opacityTransferFunction->AddPoint(2000,0.2); 

        vtkSmartPointer<vtkColorTransferFunction> colorTransferFunction = vtkSmartPointer<vtkColorTransferFunction>::New(); 
        colorTransferFunction->AddRGBPoint(0,0,0.5,0); 
        colorTransferFunction->AddRGBPoint(60,1,0,0); 
        colorTransferFunction->AddRGBPoint(255,0.8,0.8,0.8); 


Thank you in advanced! 

ZhangQiang





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150709/9475b579/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InsertPic_.jpg
Type: image/jpeg
Size: 100667 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150709/9475b579/attachment-0001.jpg>


More information about the vtkusers mailing list