[vtkusers] SetDataSpacing = SetSpacing ?

Chris Turner cturnercomplex at googlemail.com
Thu Jun 3 11:00:04 EDT 2010


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?

Thanks,
Chris

On Wed, Jun 2, 2010 at 7:48 PM, John Drescher <drescherjm at gmail.com> wrote:
> On Wed, Jun 2, 2010 at 7:17 PM, Chris Turner
> <cturnercomplex at googlemail.com> wrote:
>> Hi,
>>
>> I noticed that in the Medical4 example the spacing of the CT Image is
>> set in the vtkVolume16Reader object with the method SetDataSpacing. If
>> I want to change the spacing of the CT Image after I loaded it can I
>> do that with the SetSpacing method on a vtkImageData object? Do those
>> have the same effect?
>>
>> Because for some reason changes at the spacing of the vtkImagaData
>> seems to have no impact on the displyed rendered volume...
>>
>> Anybody knows why?
>>
>
> I believe you are supposed to use vtkImageChangeInformation for this.
>
> John
>



More information about the vtkusers mailing list