[vtkusers] How to disable a VTK filter that is connected to a VTK pipeline

Allan James ar.james at qut.edu.au
Tue Apr 20 20:33:46 EDT 2010


Hi David,

Thanks for your reply.

I hadn't thought about when the input type does not match the output type - as you say it wouldn't make sense to disable a filter in this case.

It would be interesting to hear people's thoughts on this..

cheers,

Allan James
High Performance Computing & Research Support
Queensland University of Technology
(07) 3138 9264
ar.james at qut.edu.au<mailto:ar.james at qut.edu.au>
http://www.qut.edu.au/its/hpc

><(((º>  ._.·´¯`·..  >++(((º>  ._.·´¯`·..  >++(((º>


________________________________
From: daviddoria at gmail.com [mailto:daviddoria at gmail.com] On Behalf Of David Doria
Sent: Tuesday, 20 April 2010 9:43 PM
To: Allan James
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] How to disable a VTK filter that is connected to a VTK pipeline

On Tue, Mar 30, 2010 at 11:34 PM, Allan James <ar.james at qut.edu.au<mailto:ar.james at qut.edu.au>> wrote:
Hi all,

Does anyone know if it is possible to disable a VTK filter without removing it from the pipeline?

For example, while using vtkImageMask, I would like to allow the user to be able to select whether to apply a mask to an image or not - I would like to enable/disable the vtkImageMask filter during runtime without having to disconnect/reconnect the pipeline everytime.

I am sure there are work-arounds depending on the filter in question (such as setting a null mask image perhaps?) - however, generally speaking it would be nice to be able to disable a filter and have the input data pass through untouched - is this possible in VTK?

Thanks,

Allan James

Allan,

This is a really good idea. I find myself constantly having lines like this:

nextFilter->SetInput(reader->GetOutput());
//nextFilter->SetInput(lastFilter->GetOutput());

When I want to test what happens when I skip a filter. It would make a lot more sense to call lastFilter->Disable(). In cases where the output type is the same as the input type, we could make Disable() just pass the input through to the output. In cases where they DONT match, I don't think it makes sense to disable the filter.

Any comments from the devels?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100421/6db7875c/attachment.htm>


More information about the vtkusers mailing list