[Insight-users] Re: RE: Re: Importing image data from a byte array

Chris Farmer cfarmer at scitegic.com
Wed Sep 7 21:34:15 EDT 2005



Hi Brian,
Thanks for the reply.  I understand that the PNG (or whatever other)
data that I read in will no longer be specifically PNG.  I am happy with
that.  My only issue is that my application already has *in-memory*
buffers representing image data in the PNG format.  I might be dealing
with thousands of these.  It's not clear exactly what I might have to do
with these images at the moment, but let's just assume for now that I
have the simple task of changing the image's format from PNG into TIF.
>From the examples in the itk source distribution, it appears that I
should use the ImageFileReader and ImageFileWriter and set the
appropriate filenames with extensions to read my PNG data and output TIF
data.  In my current application, this would mean that I have to write
out my buffer to a file solely to have it read back in by the
ImageFileReader (ultimately the PNGImageIO::Read method).  All I want to
do is avoid this step of writing a file.  I basically want the logic
that's within the Read method without the requirement that the data
source be a file.



Thanks,
Chris




 

-----Original Message-----
From: Brian Eastwood [mailto:beastwoo at email.unc.edu] 
Sent: Wednesday, September 07, 2005 5:49 PM
To: insight-users at itk.org
Subject: [Insight-users] Re: RE: Re: Importing image data from a byte
array

Hi Chris,

Once you have loaded image data through one of ITK's readers into an 
itk::Image object, it is no longer specifically PNG data--it's just 
image data.  For example, you could do all sorts of processing of the 
data using an ITK pipeline; you could grab the image data at any point 
in the pipeline and display it (e.g. using Qt or VTK); you could 
transfer the data buffer to another image library format and do 
something there--for example, ImageMagick.  For all of this, there is no

need to write intermediary image data to disk.  Maybe you can mention a 
bit more about what your application is supposed to do, and it's likely 
someone on the list has done something similar, or would know the 
components to tie together.

Cheers,
Brian
 


More information about the Insight-users mailing list