[vtkusers] remove vtkImageBlend item
David Gobbi
david.gobbi at gmail.com
Mon Jan 31 00:12:10 EST 2011
Hi Mauro,
The inputs can be added/removed with these vtkAlgorithm methods:
blend->AddInputConnection(0, canvas->GetOutputPort());
blend->RemoveInputConnection(0, canvas->GetOutputPort());
In all honesty, though, I find it easiest to call this:
blend->RemoveAllInputs();
Then I can start over again by adding all the inputs. Otherwise,
it can be difficult to keep the inputs in the correct order.
- David
On Sun, Jan 30, 2011 at 9:11 PM, Mauro Maiorca <mauromaiorca at gmail.com> wrote:
>
> Hello vtk users,
>
> I'm struggling to understand how to remove an item from a vtkImageBlend object.
>
> To be more specific, I have a (grayscale) 2D image and few
> vtkImageCanvasSource2D objects to interactively attach/detach to the
> greyscale image.
> In order to attach the objects to the grayscale image I'm using
> vtkImageBlend, and it's working fine.
> The problem is to detach the vtkImageCanvasSource2D objects from
> vtkImageBlend: I don't see any "remove" function in vtkImageBlend.
> Do you know whether it is possible? If vtkImageBlend is not the best
> approach to solve my problem, do you know a better (VTK) approach to
> it?
> As a quick and dirty solution, I create a new vtkImageBlend and I
> attach to it the grayscale image plus all the
> vtkImageCanvasSource2Dobjects except the one I want to "remove", it's
> working but it's (obviously) slow with a big image and a big number of
> objects.
>
> cheers,
> Mauro
> _______________________________________________
> 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