[vtkusers] Marking a pixel with a filled circle
David Gobbi
david.gobbi at gmail.com
Mon Dec 7 11:23:09 EST 2009
On Mon, Dec 7, 2009 at 8:23 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I was expecting vtkImageBlend to simply take two vtkImageData's (as
> David G. was thinking as well) and produce a third vtkImageData.
>
> Based on what you said, there are now no errors, but the two images do
> not seem to be combined in the display, I simply see the first image:
> http://www.vtk.org/Wiki/VTK_Examples_Combine_Images
The vtkImageBlend can take any number of inputs images, but all of
them go onto the first input port.
blend->SetInputConnection(a->GetOutputPort());
blend->AddInputConnection(b->GetOutputPort());
blend->AddInputConnection(c->GetOutputPort()); etc etc
All of these are added to the first port (port number 0) of the
blender. The "0" is implicit, equivalently you could use
blend->AddInputConnection(0, b->GetOutputPort()).
I know that it's confusing, but the above is not the same as the
following, which uses input port 0 for the first and input port 1 for
the second:
blend->SetInputConnection(0, a->GetOutputPort());
blend->SetInputConnection(1, stencil->GetOutputPort());
You see, the first port of vtkImageBlend is a "multiple input" port,
and it can take any number of inputs on the same port. The second
port is an "optional input" port which can take a stencil, or not.
David
More information about the vtkusers
mailing list