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

Berk Geveci berk.geveci at gmail.com
Wed Apr 5 14:11:40 EDT 2006


I have no objection to your changes since they provide backwards
compatibility. However, I think that having a SetInput with an index
on filters that have take variable number of inputs is wrong. It
allows the user/programmer to specify NULL inputs, thus requiring the
filter to check in RequestData. For example, the following:
vtkImageAppend append
append SetInput 10 foo

will cause the append filter to have 10 NULL input connections. Making
only the AppendInput(Connection) method public would prevent this
problem.

-Berk


On 4/5/06, David Gobbi <dgobbi at atamai.com> wrote:
> 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
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list