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

Home » Public Forums » archive » Re: Function BYTSCL
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: Function BYTSCL [message #24644 is a reply to message #24641] Tue, 10 April 2001 03:08 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Steffen Kernchen wrote:
>
> Hi...
>
> I�m just starting with IDL, so here is my first question: ;-)
>
> what function(s) can I use instead of BYTSCL?
> I have an array and I want to transform it to get a better contrast.
> But I should NOT use BYTSCL.... :(
>
> bye
>
> steffen

Of course you can do by hand something similar what bytscl does:

lets say your array is 'a'

minA=min(a,MAX=maxA)
a=a-minA
a=byte(float(a)/maxA*255)

(2nd line is 'optional')
but why you should not use bytarr?
Only point I can guess is that you have 8bit color and dont want to
use all colors?
In that case you have to find the different used colors in a:

h=histogram(a)
wN0=where(h ne 0,nW)

replace them:

for i=0,nW-1 do begin
wI=where(a eq wN0[i])
a[wI]=i
endfor

and modify the color table to assign the remaining values to colors
0..255:

TVLCT, R, G, B, /GET

R[0:nW-1]=byte(float(indgen(nW))/nW*255)
G[0:nW-1]=byte(float(indgen(nW))/nW*255)
B[0:nW-1]=byte(float(indgen(nW))/nW*255)

TVLCT, R, G, B

then you can plot your image.

Cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sec : U Re: Dual head displays
Next Topic: Re: Error on shutdown of widget !@$%

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

Current Time: Wed Oct 08 15:49:55 PDT 2025

Total time taken to generate the page: 0.00398 seconds