comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Q: raw data conversion
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Q: raw data conversion [message #2768] Tue, 20 September 1994 10:04
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <1994Sep19.110600.24425@msuvx1.memphis.edu>,
PAVAN VEMULAKONDA <pvemulakonda@cc.memphis.edu> wrote:
> I have some image data files with plain integer values of the pixel intensity.
> I want to convert them into any of the following formats tiff,gif,jpeg etc.
> How can I do that. How can I read the raw integer data as an image data in IDL.
> Plz help me with this problem.
>
> thanks

I assume you know the size of the file in X,Y dimensions. Let's say the
file is 1024(X) x 768(Y). The commands should be:

IDL> ifile = "name of your input file" ; input integer file
IDL> ofile = "name of your output file" ; output gif file
IDL> image = intarr(1024, 768) ; create array for storing data
IDL> openr, lun, ifile, /get_lun ; open the input file
IDL> readu, lun, image ; read the input file into the data array
IDL> free_lun, lun ; free the file lun
IDL> write_gif, ofile, bytscl(image) ; not sure if bytscl() is needed

For tiff files, sub tiff_write for write_gif. For jpeg, sub write_jpeg
for write_gif. Look in the "data_io" and "routines" categories in the
help section for other formats.

Mike Schienle Hughes Santa Barbara Research Center
8015@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
Re: Q: raw data conversion [message #2771 is a reply to message #2768] Tue, 20 September 1994 02:32 Go to previous message
fskmjm is currently offline  fskmjm
Messages: 25
Registered: November 1993
Junior Member
In article <1994Sep19.110600.24425@msuvx1.memphis.edu> pvemulakonda@cc.memphis.edu (PAVAN VEMULAKONDA) writes:

> I have some image data files with plain integer values of the pixel intensity.
> I want to convert them into any of the following formats tiff,gif,jpeg etc.
> How can I do that. How can I read the raw integer data as an image data in IDL.
> Plz help me with this problem.

> thanks

xsize=.......
ysize=.......
filename=pickfile()

image = intarr(xsize,ysize)
openr,lun,filename,/get
readu,lun,image
free_lun,lun

Make sure however that the order that your intensities are stored in, is the
same as that which IDL uses when reading.
Re: Q: raw data conversion [message #2775 is a reply to message #2771] Mon, 19 September 1994 10:24 Go to previous message
Jacques is currently offline  Jacques
Messages: 5
Registered: September 1994
Junior Member
In article <1994Sep19.110600.24425@msuvx1.memphis.edu>, pvemulakonda@cc.memphis.edu (PAVAN VEMULAKONDA) says:
>
> I have some image data files with plain integer values of the pixel intensity.
> I want to convert them into any of the following formats tiff,gif,jpeg etc.
> How can I do that. How can I read the raw integer data as an image data in IDL.
> Plz help me with this problem.
>
> thanks

For the raw 8bit/pix --> tif, gif, jpg, look at a shareware program
called Image Alchemy. You should find it on any SIMTEL mirror in the
msdos/graphics subdir. The version I use is 1.7.

Regards,

Alain
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: To RSI & Vis Numerics: Job List Resrc for IDL/PV-Wave programmers?
Next Topic: Idl question, please help...

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:47:53 PDT 2025

Total time taken to generate the page: 0.00637 seconds