<div class="gmail_quote">On Tue, Mar 30, 2010 at 11:34 PM, Allan James <span dir="ltr"><<a href="mailto:ar.james@qut.edu.au">ar.james@qut.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div><font face="Arial" size="2"><span>Hi
all,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Does anyone know if
it is possible to disable a VTK filter without removing it from the
pipeline?</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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 - </span></font><font face="Arial" size="2"><span>I would like to enable/disable the vtkImageMask filter
during runtime without having to disconnect/reconnect the pipeline
everytime.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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?</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Thanks,</span></font></div>
<div><font face="Arial" size="2"></font> </div>
<div align="left"><font face="Arial" size="2">Allan James</font></div>
<div align="left"></div></div></blockquote><div><br></div><div class="gmail_quote">Allan,</div><div class="gmail_quote"><br></div><div class="gmail_quote">This is a really good idea. I find myself constantly having lines like this:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">nextFilter->SetInput(reader->GetOutput());</div><div class="gmail_quote">//nextFilter->SetInput(lastFilter->GetOutput());</div><div class="gmail_quote">
<br></div><div class="gmail_quote">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.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Any comments from the devels?</div><br clear="all">Thanks,<br><br><div>David</div></div>