[ITK-users] SetImportPointer(T *, letContainerManageMemory)

Emma Ryan eryanvtk at yahoo.com
Fri Mar 28 19:00:26 EDT 2014


Thank you, Jim for clarifying.


Emma

On Friday, March 28, 2014 12:56 PM, Jim Miller <millerjv at gmail.com> wrote:
 
Setting LetContainerManageMemory is passing control over to ITK to manage the lifetime of that memory. You do not need to (and should not) call delete of the buffer you passed in. 

ExtractImageFilter will create a new image and a new buffer to hold the pixels of the extracted data. The lifetime of the original image will be managed by the SmartPointer. 

 

Jim

On Mar 28, 2014, at 3:43 PM, Emma Ryan <eryanvtk at yahoo.com> wrote:


Hi,
>
>
>  If I declare a variable such as 
>
>
>
>float *img = new float[500];
>
>
>and pass 'img' to the import filter with the LetContainerManageMemory = true, then do I still need to
>
>
>call delete [] img ?    Or will the filter take care of this ?. The documentation seems to imply that delete [] img will be called by ITK internally.  Just want to confirm this.
>
>
>
>Also, does the ExtractImageFilter create a new buffer for the extracted portion ? If so, do I need to clean up memory ?  Or will ITK smart pointers handle it ?
>
>
>thanks,
>Emma
_____________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Kitware offers ITK Training Courses, for more information visit:
>http://www.kitware.com/products/protraining.php
>
>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-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140328/5e3bfbab/attachment.html>


More information about the Insight-users mailing list