[vtkusers] vtkRayCaseVolume mapper in VTK 4.0

Alex Romadinoff alexeyr at netcracker.com
Fri Dec 20 13:42:30 EST 2002


Dear all,

I try to render volume data with the following code

// :skipped:
short* data=new short [1000000];

 for (int i=0; i<1000000; i++){
     data[i]=120+200*sin(i)*((i+1)%20);
 }

 vtkImageImport *img=vtkImageImport::New();

 img->SetImportVoidPointer (data);
 img->SetDataScalarTypeToShort ();
 img->SetWholeExtent (0, 100, 0, 100, 0, 100);
 img->SetDataExtentToWholeExtent ();
// ..skipped..
vtkVolumeRayCastMapper* volumeMapper=vtkVolumeRayCastMapper::New();
volumeMapper->SetVolumeRayCastFunction (compositeFunction);
volumeMapper->SetInput (img->GetOutput());
// ..skipped

When I use short or double type for data array and do
SetDataScalarTypeTo{Short|Double} the resultant rendered image is empty.

When I use unsigned char for data transition, volume is visualized well.

What's up ?
Is vtkVolumeRayCastMapper works only for unsigned char data ?

With best wishes,
Alex








More information about the vtkusers mailing list