[Insight-users] ImportImageFilter question

Stefano Maugeri stefano at camelotbio.com
Fri Dec 7 05:18:08 EST 2012


Hi everyone,

I'm using the itk::ImportImageFilter to create an itk::Image from an
existing buffer. I would like to make the itk:Image own the buffer so that
it will be the itk:Image destructor to free the buffer.
Reading the documentation I found that there's an option in the
SetImportPointer(...) method of the itk::ImportImageFilter class, that
allows the filter to own the buffer, but after the update the resulting
image (I think as expected) is empty.
If I set itk::ImportImageFilter not to own the buffer the itk:Image is not
empty but it doesn't own the buffer (if I delete the itk::Image, the buffer
is still allocated in memory).
Since I create an itk:Image and then I return it I would like to make the
itk:Image own the buffer so that I can delegate the itk:Image destructor to
free the buffer, without the needing to return also the buffer pointer and
use it to free the buffer or to create the itk:Image by copy.

I am looking forward to an answer.
Thanks in advance.

-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121207/ee461c1c/attachment.htm>


More information about the Insight-users mailing list