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

Home » Public Forums » archive » Re: How to read 16-bit UNSIGNED data
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: How to read 16-bit UNSIGNED data [message #1744] Fri, 18 February 1994 11:12
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
knipp@ipi.uni-hannover.de (K Knipp) writes:



> I have to read image data which are written as 16 Bit per Pixel,
> UNSIGNED and with a range of 0 to 65535.

> INTEGER Variable in IDL are defined to range from -32767 to 32768.

> Is the following way to read the data correct?

> OPENR, UNI, FILE, /GET
> I = ASSOC(UNI, INTARR(WIDTH,ROW),OFFSET)
> IMA = I(0)
> FREE_LUN, UNI

> IMA2 = LONG(IMA)
> POS = WHERE(IMA2 LT 0)
> IF POS(0) NE -1 THEN IMA2(POS) = IMA2(POS) + 65535L


Better would be to say

IMA2 = LONG(IMA) AND 'FFFF'X

Bill Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Wigner-Ville distribution code
Next Topic: formated text entry fields

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

Current Time: Wed Oct 08 17:25:19 PDT 2025

Total time taken to generate the page: 0.00503 seconds