[vtkusers] vtkRayCaseVolume mapper in VTK 4.0

Amy Henderson amy.henderson at kitware.com
Fri Dec 20 13:44:27 EST 2002


At 09:42 PM 12/20/2002 +0300, Alex Romadinoff wrote:
>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 ?

It will handle unsigned char or unsigned short data.
- Amy

>With best wishes,
>Alex
>
>
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers







More information about the vtkusers mailing list