[vtkusers] vtkTransformFilter in pipeline using Python

Stefan Dietrich stef.dietrich.imap at googlemail.com
Sat Dec 12 08:35:25 EST 2009


Hi there,
I have a question dealing with the affine transformation in Python.
I use an image from itk which I convert to an vtk image

- itk_vtk_converter = itk.ImageToVTKImageFilter[
image_type].New()
- itk_vtk_converter.SetInput( gauss_filterz.GetOutput() )
- itk_vtk_converter.Update()

and afterwards I set up the transformation
and the transformation filter.

- import vtk

- trans= vtk.vtkTransform()
- trans.Translate(100,100,100)
- trans.PostMultiply()
- trans.RotateZ(30)
- trans.Update()

- tfilter = vtk.vtkTransformFilter()
- tfilter.SetTransform(trans)
- tfilter.SetInput(itk_vtk_converter.GetOutput())
- tfilter.Update()

The I tried to give the output of the transformation filter to the volume
mapper

volume_mapper = vtk.vtkVolumeRayCastMapper()
volume_mapper.SetInput( tfilter.GetOutput() )

But after execution of the script I get the empty renderer window and the
error message


ERROR: In ..\..\vtk-5.4.2\Filtering\vtkDemandDrivenPipeline.cxx, line 728
vtkStreamingDemandDrivenPipeline (0D4C0AA0): Input port 0 of algorithm
vtkVolumeRayCastMapper(0D476A48) has 0 connections but is not optional.

(072A8E20) has 0 connections but is not optional.


I think there is somethin wrong with the in- or output to or from the
transformation filter.

Maybe someone knows what I'm missing out.

Thanks Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091212/ac4819f1/attachment.htm>


More information about the vtkusers mailing list