16 bit images? [message #13274] |
Tue, 27 October 1998 00:00  |
Scott Norton
Messages: 6 Registered: October 1998
|
Junior Member |
|
|
I"m new to these discussions, but I had a question about IDL and
PV-WAVE.
Currently, I have a demo version of PV-WAVE and I seem to be running
into
the problem that many of the functions work only for 8bit images. I
have a 16bit
gray level image I would like to analyze. Is my cursory view wrong?
Does IDL
work better with 16bit images?
Any comments would be appreciated.
Thanks!
-Scott
nortonsm@hotmail.com
|
|
|
Re: 16 bit images? [message #13304 is a reply to message #13274] |
Mon, 02 November 1998 00:00  |
Erard
Messages: 11 Registered: November 1997
|
Junior Member |
|
|
In article <MPG.109fbf7097dfc4019896e2@news.frii.com>, davidf@dfanning.com
(David Fanning) wrote:
> Note: This is a copy of an article was posted to the IDL newsgroup.
>
> Scott Norton (Scott_Norton@surromed.com) writes:
>
>> I"m new to these discussions, but I had a question about IDL and
>> PV-WAVE.
>> Currently, I have a demo version of PV-WAVE and I seem to be running
>> into
>> the problem that many of the functions work only for 8bit images. I
>> have a 16bit
>> gray level image I would like to analyze. Is my cursory view wrong?
> �
> If these images are unsigned 16-bit values I can imagine
> you might be having some problems. There are some tips on
> my web page about how to handle that kind of data.
> Fortunately, IDL 5.2 is suppose to have a new 16-bit unsigned
> integer data type, so even these problems may be a thing
> of the past soon.
>
> Cheers,
>
> ----------------------------------------------------------
> David Fanning, Ph.D.
Here is a routine that converts 16-bits signed arrays to 32-bits (un)signed
data. This is useful to convert output of CCDs� to something IDL can
handle. It can manage structures.
S. Erard
function conv_int,arg
;+
; NAME:
; conv_int
;
; PURPOSE:
; converts 16 bits (signed) integers to 32 bits unsigned integers.
; (to get the Virtis or other data back with full dynamics).
; Works on scalars, arrays, and recursively on structures.
;
; CALLING SEQUENCE:
;
; Result = CONV_INT(arg)
;
;
; INPUTS:
; Arg: 16 bits integer to be converted
;
;
; KEYWORD PARAMETERS:
; NONE
;
; OUTPUTS:
; This function returns a positive 32 bit integer version of the
; input argument if it is a short integer. Left untouched otherwise.
;
; EXAMPLE:
;
; F = CONV_INT(arg)
; Returns an unsigned 16 bits value coded as long-word.
;
; MODIFICATION HISTORY:
; Written by: Stephane Erard, 18 feb 1997
;-
t = arg ;Make a copy
s = size(t)
case s(s(0)+1) of ;Type code
2: BEGIN ; if short integer, convert and keep the unsigned value
ind=where(t lt 0, count)
out=long(t)
if count NE 0 then out(ind)=t(ind) + 65536L
return, out
END
8: for i=0, n_tags(t)-1 do t.(i) = conv_int(t.(i)) ;Structure
ELSE: BEGIN
print, 'The parameter must be short integer (unchanged)'
return, t
END
ENDCASE
end
--
St�phane Erard
Institut d'Astrophysique Spatiale
Orsay, France
http://www.ias.fr/cdp/index.html
erard@ias.fr
|
|
|