[vtkusers] using vtkVolumeRayCastMapper to render vtkSampleFunction
Patrick de Koning
patrick at lkeb.azl.nl
Fri Jan 12 02:44:42 EST 2001
Wolfram H Volpi wrote:
>
> Hi, everybody!
> I'm trying to rayCast-render a volume generated by vtkSampleFunction.
> It doesn't work because,
>
> vtkVolumeRayCastMapper (0x80c9ef8): The scalar data type: 10 is not
> supported when volume rendering. Please convert the data to unsigned
> char or unsigned short.
>
> How do I do that?
>
vtkImageCast
> The problem code is listed below. It makes my PC go into virtual
> memeory. My PC has 250 MB of RAM.
>
> Thank you,
> Woflv.
> -------------------------------------------------------------------------------
> source $VTK_TCL/vtkInt.tcl
>
> # goes into virtual memeory!
> vtkSphere sphere
> sphere SetRadius 1
>
> vtkSampleFunction sample
> sample SetImplicitFunction sphere
>
> vtkVolumeProperty volumeProperty
> volumeProperty SetInterpolationTypeToNearest
>
> vtkVolumeRayCastMIPFunction MIPFunction
>
> vtkVolumeRayCastMapper volumeMapper
> volumeMapper SetInput [sample GetOutput]
> volumeMapper SetVolumeRayCastFunction MIPFunction
> volumeMapper SetSampleDistance 0.25
>
> vtkVolume volume
> volume SetMapper volumeMapper
> volume SetProperty volumeProperty
>
> # graphics stuff
> vtkRenderer ren1
> ren1 SetBackground 0.1 0.2 0.4
> vtkRenderWindow renWin
> renWin AddRenderer ren1
> renWin SetSize 256 256
> vtkRenderWindowInteractor iren
> iren SetRenderWindow renWin
>
> ren1 SetBackground 0 0 0
>
> ren1 AddVolume volume
> renWin SetSize 200 200
> renWin Render
>
> iren SetUserMethod {wm deiconify .vtkInteract}
> iren SetDesiredUpdateRate 1
> iren Initialize
>
> wm withdraw .
>
> _______________________________________________
> 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
--
--------------------------------------------------------------------
Ir. P.J.H. de Koning Leiden University Medical Center
Department of Radiology, C2S Division of Image Processing
P.O. Box 9600 2300 RC LEIDEN
the Netherlands Tel. +31-71-5266206
Fax +31-71-5266801 Email patrick at lkeb.azl.nl
More information about the vtkusers
mailing list