[vtkusers] pipelines connections

Lic. José M. Rodriguez Bacallao jmrbcu at gmail.com
Wed Dec 2 14:48:41 EST 2009


and for example, with an vtkImageActor, it only accept vtkImageData
objects as input with the SetInput method, how do I get an
vtkImageData object, for example, from vtkImageReslice with the new
style connections, or do I have to use reslice.GetOutput() old style?

On 12/2/09, David E DeMarle <dave.demarle at kitware.com> wrote:
> You should use the new style. It actually connects the algorithms together.
>
> The old style is still there for backward compatibility. In principle
> it means connect the data produced by one algorithm to some other
> algorithm. That should mean that if the first algorithm changes and
> produces something new, then the second algorithm would never notice
> it. In practice there is the following magic (in some but not all
> algorithms of) vtk which converts the old style call to a new style
> one and makes them equivalent.
>
> //----------------------------------------------------------------------------
> void vtkRectilinearGridAlgorithm::SetInput(vtkDataObject* input)
> {
>   this->SetInput(0, input);
> }
>
> //----------------------------------------------------------------------------
> void vtkRectilinearGridAlgorithm::SetInput(int index, vtkDataObject* input)
> {
>   if(input)
>     {
> //HERE IS THE MAGIC
>     this->SetInputConnection(index, input->GetProducerPort());
> //HERE IS THE MAGIC
>     }
>   else
>     {
>     // Setting a NULL input removes the connection.
>     this->SetInputConnection(index, 0);
>     }
> }
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-371-3971 x109
>
>
>
> On Wed, Dec 2, 2009 at 11:26 AM, Lic. José M. Rodriguez Bacallao
> <jmrbcu at gmail.com> wrote:
>> Hi folks, I need to know which type of pipeline objects connections to
>> use, the new style connections:
>> object2.SetInputConnection(object1.GetOutputPort()) or the old style:
>> object2.SetInput(object1.GetOutput()). This different connection types
>> affect in performance or something, which are the advantages?
>>
>> PS: If possible, please, mail an example of the differences!!!
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -----------------------------------------------------------------
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
>> mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -----------------------------------------------------------------
>> _______________________________________________
>> 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
>>
>


-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------



More information about the vtkusers mailing list