<div dir="ltr">I think what you are looking for is the ReleaseDataFlag on each filter.  If you set it to be true<div style><a href="http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a53e43274d2e5da52630d7d157d272769">vtkAlgorithm::ReleaseDataFlagOn()</a> the data will be released after the next filter is done with it and only recomputed when the filter is updated.  By using setInput(NULL) you were causing the filter to recompute (with no input) and breaking the pipeline.</div>
<div style><br></div><div style>HTH,</div><div style>Shawn</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 27, 2013 at 5:41 PM, johnsonjonaris <span dir="ltr">&lt;<a href="mailto:jgadel2@uic.edu" target="_blank">jgadel2@uic.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All<br>
I am making a vtk pipeline to visualize models out of a label volume. The<br>
volume contains integral data (integer numbers). I make a loop of the<br>
following pipeline to visualize the models. The pipeline is as follow:<br>
vtkImageData (volume)<br>
-&gt; vtkImageThreshold(at every value)<br>
-&gt;vtkMarchingCubes(at the specific value)<br>
-&gt; vtkDecimatePro<br>
-&gt;vtkWindowedSincPolyDataFilter<br>
-&gt;vtkPolyDataNormals<br>
-&gt;vtkStripper<br>
-&gt;vtkPolyDataMapper<br>
-&gt;vtkActor<br>
-&gt;vtkRenderer (add Actor)<br>
-&gt; vtkWidget (GetRenderWindow()-&gt;Render()) // this invoke the whole pipeline<br>
everytime in the loop<br>
<br>
In order to control the memory usage, I clean the filters at the end of the<br>
loop using:<br>
<br>
        if (stripper) { stripper-&gt;SetInput(NULL); stripper = NULL; }<br>
        if (normals) { normals-&gt;SetInput(NULL); normals = NULL; }<br>
        if (smoother) { smoother-&gt;SetInput(NULL); smoother = NULL; }<br>
        if (decimator) { decimator-&gt;SetInput(NULL); decimator = NULL; }<br>
        if (mcubes) { mcubes-&gt;SetInput(NULL); mcubes = NULL; }<br>
        if (imgToStrPnts) { imgToStrPnts-&gt;SetInput(NULL); imgToStrPnts =<br>
NULL; }<br>
        if (threshold) { threshold-&gt;SetInput(NULL); threshold = NULL; }<br>
<br>
The modules are displayed as I want, but I get the following error message<br>
several times:<br>
<br>
ERROR: In ..\..\vtk-5.6.1\Filtering\vtkDemandDrivenPipeline.cxx, line 727<br>
vtkStreamingDemandDrivenPipeline (000000001BB996F0): Input port 0 of<br>
algorithm vtkStripper(000000001B77C910) has 0 connections but is not<br>
optional.<br>
<br>
If remover the memory cleaning part, I get no ERRORS, but the memory is<br>
heavily consumed.<br>
Please advise on how to correct the pipeline.<br>
<br>
Also, will it be better to use vtkDiscreteMarchingCubes<br>
<br>
Regards<br>
Johnson<br>
<br>
<br>
<br>
-----<br>
Johnson Jonaris<br>
PhD Candidate<br>
Electrical &amp; Computer Eng<br>
University of IL at Chicago<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtk-pipeline-problem-tp5721639.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtk-pipeline-problem-tp5721639.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>