[Insight-users] Re: Importing image data from a byte array
Brian Eastwood
beastwoo at email.unc.edu
Tue Sep 6 22:06:32 EDT 2005
Hi Chris,
You are looking for the itk::ImportImageFilter. An example of how to
use it is in the Getting Started V guide available here:
http://www.itk.org/HTML/Tutorials.htm
You first need to set up the size, origin, and spacing of your image.
The method ImportImageFilter::SetImportPointer() allows you to pass the
pointer to your image buffer--you specify the size of the image buffer
and indicate whether you want ITK to manage the buffer memory.
Hope this helps.
Brian
>Message: 4
>Date: Tue, 6 Sep 2005 16:21:04 -0700
>From: "Chris Farmer" <cfarmer at scitegic.com>
>Subject: [Insight-users] Importing image data from a byte array
>To: <insight-users at itk.org>
>Message-ID:
> <830D8D4719112B418ABBC3A0EBA958128FA568 at webmail.scitegic.com>
>Content-Type: text/plain; charset="us-ascii"
>
>
>Hi. I've just started working with the ITK library and have a simple
>question. In my current application, I have a byte array that contains
>image data (usually in png format). I'd like to use that data in the
>ITK world, but I can't see a good way to use it without first writing
>out a file and using the standard reader model that is shown in the
>examples. I poked through the ImageIOBase code to see how easy it would
>be to use a byte array as a data source instead of a file, but it didn't
>seem too obvious.
>
>Can someone please give me a pointer to using a byte array as a source
>of image data?
>
>
>Thanks,
>Chris
>
More information about the Insight-users
mailing list