[vtkusers] image algorithm with multiple inputs

Michael Jackson mike.jackson at bluequartz.net
Tue Jul 28 14:40:39 EDT 2009


In the constructor set:
   this->SetNumberOfInputPorts(0);

to what ever you need.

The over ride:

//  
-----------------------------------------------------------------------------
//
//  
-----------------------------------------------------------------------------
int YourFilterClass::FillInputPortInformation(int port ,  
vtkInformation *info)
{
if (port == 0)
   info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");

if (port == 1)
    info->Set...
   return 1;
}

If all the inputs are the same then you can do without the if (port  
== .. ) lines.

Hope that helps.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Jul 28, 2009, at 2:22 PM, Dominik Szczerba wrote:

> I want to write an image manipulation algorithm taking a few inputs.  
> Of course I can hack them in by custom AddInput() function but was  
> actually wondering how to do it the right VTK way. Any hints where  
> to start are appreciated.
>
> with regards,
> Dominik
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list