[vtk-developers] Image multiple input filters, VTK 5 vs VTK 4

David Gobbi dgobbi at atamai.com
Wed Apr 5 13:53:28 EDT 2006


Hi All,

When the VTK multiple-input imaging filters were
moved to the new pipeline, some backwards
incompatibilities crept in. I've already fixed
in vtkImageBlend but want to get some comments
before I do the rest.

The issue is that in VTK 4, the basic interface
was as follows:

 void AddInput(vtkImageData *);
 void SetInput(int idx, vtkImageData *);

In VTK 5, the multiple-input imaging filters take
all of their inputs on the first input port.
The AddInput() method works as before, since it
appends inputs to the first port, but SetInput()
works different in VTK 5:
 
 // set input for specified port
 void SetInput(int port, vtkDataObject *)

If anyone has old VTK 4 code that calls
SetInput(1, data), that code will break because
the filter expects all inputs to go on the first
port, not on successive ports.  You would think
that regression testing would have caught this,
except that the tests were all changed at the
same time that VTK was changed (!!!).

In brief, what I want to do is change the
following filters so that SetInput() will work
the same way as in VTK 4:

 vtkImageAppend
 vtkImageAppendComponents
 vtkImageBlend (already done)

Take a look at my recent three cvs changes to
vtkImageBlend if you want to see exactly what
the changes will be.

If anyone thinks there will be any issues with
this change, or if there are other VTK classes
that need this change, please email me.

Cheers,
 - David



More information about the vtk-developers mailing list