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

Home » Public Forums » archive » Re: Fanning's LogScl routine + Colorbar??
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: Fanning's LogScl routine + Colorbar?? [message #71837 is a reply to message #71836] Fri, 23 July 2010 12:38 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Joe Daal writes:

> I am using the logscl to enhance the contrast of an image, something
> like:
>
> loadct,39
> image = alog10(lin_image)
> imdisp, logscl(image, min=min(image), max=max(image), Exponent=8,
> Mean=0.65)
>
> where image values vary from -1.34 to +2.05, with zeroes included.
> The image looks nice for what I want, but how do I reflect a correct
> colorbar, either for real values or the scaled ones? What is
> logarithmic, the ticks or the colors?

If you are going to display a color bar, wouldn't you
have to transform the color bar values in the same
way to transform the image?

I am thinking code like this:

;*********************************************************** **
image = LoadData(11)
freqDomainImage = FFT(image, -1)
power = SHIFT(ALOG(ABS(freqDomainImage)), 124, 124)
power = power - Min(power)

minmax, power
ctload, 4, /brewer, /reverse
tvlct, r, g, b, /get
rr = scale_vector(float(r), min(power), max(power), $
MIN=0, MAX=255)
gg = scale_vector(float(g), min(power), max(power), $
MIN=0, MAX=255)
bb = scale_vector(float(b), min(power), max(power), $
MIN=0, MAX=255)
rrr = logscl(rr, MEAN=0.45)
ggg = logscl(gg, MEAN=0.45)
bbb = logscl(bb, MEAN=0.45)
tvlct, rrr, ggg, bbb
cindex

window, xsize=500, ysize=500, Title='Log Display'
TVImage, LogScl(power, MEAN=0.45), $
position=[0.1, 0.1, 0.9, 0.75], /erase
colorbar, range=[min(power), Max(power)], $
division=4, format='(f0.2)'

ctload, 4, /brewer, /reverse
window, 1, xsize=500, ysize=500, Title='Normal Display'
TVImage, BytScl(power), position=[0.1, 0.1, 0.9, 0.75], /erase
colorbar, range=[min(power), Max(power)], $
division=4, format='(f0.2)'
END
;*********************************************************** **

Here are the results from running this program:

http://www.dfanning.com/misc/logscl.png

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to run a program for datasets located in different folders at a single stretch
Next Topic: Inequation resolution with IDL?

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

Current Time: Mon Oct 27 15:18:33 PDT 2025

Total time taken to generate the page: 0.56778 seconds