How to read 16-bit UNSIGNED data [message #1749] |
Fri, 18 February 1994 05:51 |
knipp
Messages: 68 Registered: January 1993
|
Member |
|
|
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
Karl
____________________________________________________________ __________________
__ ____ __
/ // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922
/ // /_/ // / University of Hannover fax: +49 511 - 762 2483
/ // ____// / Institute for Photogrammetry
/ // / / / Nienburger Str.1
/_//_/ /_/ FRG 30167 Hannover 1 email: knipp@ipi.uni-hannover.de
|
|
|