[Insight-developers] SmartPointers

Maria Alejandra Zuluaga Valencia mariazulv at yahoo.es
Thu Aug 20 11:36:01 EDT 2009


Thanks a lot. It did work.




________________________________
De: kent williams <norman-k-williams at uiowa.edu>
Para: ITK <insight-developers at itk.org>
Enviado: miércoles, 19 de agosto, 2009 10:42:30
Asunto: Re: [Insight-developers] SmartPointers

 Re: [Insight-developers] SmartPointers 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/20090820/c4999772/attachment.htm>


More information about the Insight-developers mailing list