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

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 8 19:19:27 EDT 2005


Hi Chris,

Please read the ITK Tutorials

     http://www.itk.org/HTML/Tutorials.htm

in particular

  "Getting Started V: Integrating ITK in your Application"
http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf


This tutorial describes multiple strategies for passing data
between an ITK image and a byte array to and from your
application.

Some examples on this issue are also presented in the ITK
Software Guide


         http://www.itk.org/ItkSoftwareGuide.pdf


in the "Data Representation"  chapter.


They will show you how to use the existing buffers in memory
and use them to build ITK images without having to duplicate
the data.



    Regards,


       Luis



------------------
Chris Farmer wrote:
> 
> 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
>  
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 



More information about the Insight-users mailing list