[Insight-users] itkImageSource for block of memory

Andreas Schuh andreas.schuh.84 at googlemail.com
Fri Jun 19 11:43:22 EDT 2009


Hi Koen,

the MATLAB API gives you C array of the image pixel data. You can set  
this pixel buffer directly as pixel buffer to be used by an instance  
of itk::Image. So you don't need to copy any byte of the image pixel  
data.

Have a look at itk::Image::GetPixelContainer()
and itk::ImportPixelContainer::SetImportPointer().

--
regards
Andreas

On Jun 19, 2009, at 12:34 PM, Koen Vermeer <koen at vermeer.tv> wrote:

> Hi,
>
> When interfacing ITK from a different program, I already have my image
> in memory. When applying ITK operations, I now first copy the image  
> into
> an itk::Image. For small images, that's not that much of a problem,  
> but
> for large 3D data sets, I'd rather avoid this.
>
> The best way to that that is probably to define some itkImageSource  
> for
> a block of memory. I assume that writing such a class wouldn't be too
> difficult, but looking at itkImageSource, I have no idea where to  
> start.
>
> Does the approach of writing an itkImageSource for this purpose sound
> right? What methods should I override?
>
> My final goal is to use this as an interface to Matlab data.
>
> Best,
> Koen
>
> _____________________________________
> 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-users


More information about the Insight-users mailing list