[Insight-developers] SmartPointers

kent williams norman-k-williams at uiowa.edu
Wed Aug 19 11:42:30 EDT 2009


If you assign the output of a filter to a smart pointer, e.g.

ImageType::Pointer ip = filter->GetOutput();
filter = FilterType::Pointer(); // force filter deletion by assigning empty
smart pointer.

the pointer Œip¹ should still point to a valid image, since when the filter
is deallocated, Œip¹ still holds a reference.

On 8/19/09 10:19 AM, "Maria Alejandra Zuluaga Valencia" <mariazulv at yahoo.es>
wrote:

> Hi,
> I am using a pipeline made up of several filters. Since the size of my image
> is very big, the application usually crashes because I lack of memory. My
> first idea to solve this problem was to, at a certain point, recover the
> resulting image and erase all the filters that I have been using up to that
> point. I use this image to feed up the rest of the pipeline.
> 
> Nevertheless, I found that this does not works since once I unregister the
> filters the image I have kept (in a separate variable) doesn't exist anymore.
> 
> Is there a solution for this problem?
> 
> Thanks a lot,
> 
> Maria
> 
>  
> 
> _______________________________________________
> 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 ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090819/45fac09f/attachment.htm>


More information about the Insight-developers mailing list