[vtkusers] vtk pipeline problem

Shawn Waldon swaldon at cs.unc.edu
Thu Jun 27 17:50:34 EDT 2013


I think what you are looking for is the ReleaseDataFlag on each filter.  If
you set it to be true
vtkAlgorithm::ReleaseDataFlagOn()<http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a53e43274d2e5da52630d7d157d272769>
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.

HTH,
Shawn


On Thu, Jun 27, 2013 at 5:41 PM, johnsonjonaris <jgadel2 at uic.edu> wrote:

> Dear All
> I am making a vtk pipeline to visualize models out of a label volume. The
> volume contains integral data (integer numbers). I make a loop of the
> following pipeline to visualize the models. The pipeline is as follow:
> vtkImageData (volume)
> -> vtkImageThreshold(at every value)
> ->vtkMarchingCubes(at the specific value)
> -> vtkDecimatePro
> ->vtkWindowedSincPolyDataFilter
> ->vtkPolyDataNormals
> ->vtkStripper
> ->vtkPolyDataMapper
> ->vtkActor
> ->vtkRenderer (add Actor)
> -> vtkWidget (GetRenderWindow()->Render()) // this invoke the whole
> pipeline
> everytime in the loop
>
> In order to control the memory usage, I clean the filters at the end of the
> loop using:
>
>         if (stripper) { stripper->SetInput(NULL); stripper = NULL; }
>         if (normals) { normals->SetInput(NULL); normals = NULL; }
>         if (smoother) { smoother->SetInput(NULL); smoother = NULL; }
>         if (decimator) { decimator->SetInput(NULL); decimator = NULL; }
>         if (mcubes) { mcubes->SetInput(NULL); mcubes = NULL; }
>         if (imgToStrPnts) { imgToStrPnts->SetInput(NULL); imgToStrPnts =
> NULL; }
>         if (threshold) { threshold->SetInput(NULL); threshold = NULL; }
>
> The modules are displayed as I want, but I get the following error message
> several times:
>
> ERROR: In ..\..\vtk-5.6.1\Filtering\vtkDemandDrivenPipeline.cxx, line 727
> vtkStreamingDemandDrivenPipeline (000000001BB996F0): Input port 0 of
> algorithm vtkStripper(000000001B77C910) has 0 connections but is not
> optional.
>
> If remover the memory cleaning part, I get no ERRORS, but the memory is
> heavily consumed.
> Please advise on how to correct the pipeline.
>
> Also, will it be better to use vtkDiscreteMarchingCubes
>
> Regards
> Johnson
>
>
>
> -----
> Johnson Jonaris
> PhD Candidate
> Electrical & Computer Eng
> University of IL at Chicago
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/vtk-pipeline-problem-tp5721639.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130627/fc27f8af/attachment.htm>


More information about the vtkusers mailing list