[vtkusers] Does VTK have higher memory usage in python
Jothybasu Selvaraj
jothybasu at gmail.com
Thu Oct 27 06:08:36 EDT 2011
Use clip.SetInputConnection(input.GetOutputPort()).
Otherwise it will make a copy of the input foe each iteration!
Jothy
On Thu, Oct 27, 2011 at 11:04 AM, Bryn Lloyd <lloyd at itis.ethz.ch> wrote:
> Is the memory usage higher in python than in C++?****
>
> ** **
>
> I am not sure, but am having issues with large memory usage for simple
> things like clipping a large dataset.****
>
> ** **
>
> My system memory usage is around 20GB, the dataset on file is “only” 2GB.*
> ***
>
> ** **
>
> The pipeline looks like this: reader->clip polydata->writer****
>
> ** **
>
> ** **
>
> How can I reduce the memory footprint? Here is some example code:****
>
> ** **
>
> reader = vtkXMLPolyDataReader()****
>
> reader.SetFileName(ifname)****
>
> reader.Update()****
>
> input = reader.GetOutput()****
>
> ** **
>
> # do multiple clips****
>
> for k in range(10):****
>
> # compute implicit box (not shown)****
>
> clip = vtkClipPolyData()****
>
> clip.SetClipFunction(box)****
>
> clip.SetInput(input)****
>
> ****
>
> fnameo = bnameo + "_clipped%05d.vtp" % k****
>
> writer = vtkXMLPolyDataWriter()****
>
> writer.SetInput(clip.GetOutput())****
>
> writer.SetFileName(fnameo)****
>
> writer.SetDataModeToAppended()****
>
> writer.SetEncodeAppendedData(0)****
>
> writer.Write()****
>
> ** **
>
> ** **
>
> Thanks****
>
> Bryn****
>
> ** **
>
> _______________________________________________
> 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
>
>
--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111027/a9bb83ea/attachment.htm>
More information about the vtkusers
mailing list