[vtkusers] memory management

Maarten Beek beekmaarten at yahoo.com
Mon May 2 11:42:15 EDT 2016


This pipeline actually resides inside a from vtkImageAlgorithm derived class.The filters are created (<>::New()) in this class' constructor. The calls to ReleaseDataFlag() for each of the filters are also made in the constructor.
In the RequestData() function, I connect the input to the first filter in the pipeline using SetInputData().
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
vtkImageData* input = vtkImageData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));firstfilter->SetInputData(input);
 Then I call Update() on the last filter in the pipeline and copy the output of the last filter into the output of my custom filter:
vtkInformation* outInfo = outputVector->GetInformationObject(0);vtkImageData* output = vtkImageData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));

lastfilter->Update();output->ShallowCopy(lastfilter->GetOutput());

I have also tried to create and delete the filters in the RequestData() and using DeepCopy() instead of ShallowCopy(), but this did not help.
Maarten

 

    On Sunday, May 1, 2016 2:14 PM, Donny Zimmerman <zmanvortex at gmail.com> wrote:
 

 I would also like to know more information on this.

Sent from my iPhone
On Apr 29, 2016, at 12:39 PM, Maarten Beek <beekmaarten at yahoo.com> wrote:


I have a pipeline of 9 image filters.For every filter I call ReleaseDataFlagOn();
In Windows task Manager I see that before the pipeline executes my memory usage is 2.7GB, after the pipeline has executed it is 8GB.I am using VTK 6.1, Is there something I don't understand re. the ReleaseDataFlagOn() call?
Thanks - Maarten




   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160502/d37ceefb/attachment.html>


More information about the vtkusers mailing list