[vtkusers] how to solve the terrace effect in volume rendering by using vtkVolumeRayCastCompositeFunction?

朱文武 cool.wenwu at gmail.com
Wed May 19 22:52:39 EDT 2010


 hey all,
i sent this problem several days ago, but i did not get a satisfactory
answer. May by the information i provided is not sufficient, so i ask all
again with more information.
I use vtkVolumeRayCastCompositeFunction to do volume rendering, use
vtkPiecewiseFunction to do opacity transfer, and vtkColorTransferFunction to
do color transfer.
The code i use is as the same as in example of
vtkVolumeRayCastCompositeFunction  in vtkhelp. when the program read Dicom
type dataset, the result is perfect. However, when the program read bmp type
dataset, there is a terrace effect in the model which can viewed in the
attached images.
Besides, i make a test. I use Amira to read bmp dataset, and do volume
rendering.  The result is also perfect, does this test prove the dataset is
right?
Can anyone tell me why and give a solution?  i have spent several days
exploring the solution.

thanks in advance!

The code about reading bmp images is as follows:
vtkBMPReader *BMP = vtkBMPReader::New();
BMP->SetFilePrefix("E:/Data/brain/TCVH_");
    BMP->SetFilePattern("%s%d.bmp");
    BMP->Allow8BitBMPOn();
    BMP->SetDataByteOrderToLittleEndian();
    //BMP->SetFileNameSliceOffset(5);
    BMP->SetFileNameSliceOffset(1400);
    BMP->SetFileNameSliceSpacing(1);
    BMP->SetNumberOfScalarComponents(3);
    BMP->SetDataSpacing(0.167,0.167,0.15);
    BMP->SetDataOrigin(0.0,0.0,0.0);
    BMP->SetDataExtent(0,329,0,345,0,40);
    BMP->Update();

[image: dafd.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100520/962142a7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 152228 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100520/962142a7/attachment.png>


More information about the vtkusers mailing list