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 #71834 is a reply to message #71833] Fri, 23 July 2010 13:10 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
And one last message for the day :)

The two color bars plotted here

http://hea-www.cfa.harvard.edu/~pgrigis/idl_stuff/colbars.pn g

represent the same color scaling of table 5 (stretched
logarithmically )
but the linear representation does compress the "interesting" bits
of the color bar quite strongly on the left side - while the log
representation seems to do a better job of display the quick variation
at the left end.

Ciao,
Paolo


On Jul 23, 3:38 pm, David Fanning <n...@dfanning.com> wrote:
> 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: Wed Oct 08 19:33:30 PDT 2025

Total time taken to generate the page: 0.00399 seconds