[vtkusers] SetDataSpacing = SetSpacing ?

John Drescher drescherjm at gmail.com
Thu Jun 3 11:13:25 EDT 2010


On Thu, Jun 3, 2010 at 11:00 AM, Chris Turner
<cturnercomplex at googlemail.com> wrote:
> Hi John!
>
> Thanks for your answer! But it still has no impact on the rendered
> volume. Maybe there is something wrong with my pipeline. This is
> basically the code I'm using:
>
> # Get volume from another instance
> inputVolume = scene.GetNodeByID(inVolume)
>
> # The volume will be displayed by ray-cast alpha compositing.
> # A ray-cast mapper is needed to do the ray-casting, and a
> # compositing function is needed to do the compositing along the ray.
> rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction()
>
> changer=vtk.vtkImageChangeInformation()
> changer.SetInput(inputVolume.GetImageData())
> changer.SetOutputSpacing(0.4,0.4,0.38)
> changer.SetOutputOrigion(-49.424,-97.42,-14.825)
>
> volumeMapper = vtk.vtkVolumeRayCastMapper()
> volumeMapper.SetInput(chnager.GetOutputPort())
> volumeMapper.SetVolumeRayCastFunction(rayCastFunction)
>
> Volume = vtk.vtkVolume()
> Volume.SetMapper(volumeMapper)
>
> renderer.AddViewProp(Volume)
>
>
> Looks good to me - what do you think?
>

Possibly need to call changer.Update(); before
volumeMapper.SetInput(chnager.GetOutputPort())

John



More information about the vtkusers mailing list