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

Home » Public Forums » archive » Unknown data type
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Unknown data type [message #42115 is a reply to message #42107] Wed, 29 December 2004 05:43 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Julio wrote:

> Hello folks,
>
> I can read byte or integer images using byte or integer arrays, like:
>
> byte_image=bytarr(samples, rows) or
> integer_image=intarr(samples, rows)
>
> In both cases I must know the data type. But, when I don't know the
> data type, how can I do to read the images? Is there some way to
> verify the file format before reading into an array?
>
> Thanks for comments and happy New Yearᅵ
>
> Julio

This depends on what else you know about the data.
In your case it's only the type case which you want to determine. If you
probably knows how much lines and columns the image should have then it is
easy to calculate from the file size the length of the type you need for
reading the whole file. If you got 4byte as type it could be long or float.
Both will be able to read the whole file. You could first read it by float
and then test if float is necessary. If not read it a second time by long.

cheers
Reimar



--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GUI builder limitations?
Next Topic: passing objects between GUI callbacks

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

Current Time: Sun Nov 30 01:00:43 PST 2025

Total time taken to generate the page: 0.64557 seconds