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 #71835 is a reply to message #71834] Fri, 23 July 2010 12:53 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Jul 23, 3:51 pm, Paolo <pgri...@gmail.com> wrote:
> 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
>
> Hi David,
> it looks like two different color tables have been used for the two
> images:
> the one on the left looks more green and the one on the right looks
> more blue.
> This makes it harder to see what is really going on.
>
> I tried your commands with black and white colors, but the bar looks
> then identical in both plots...

OK - i see why - you scaled the colors and not the data.
Still I would argue that using log scaling should not alter the
original colors?

Ciao,
Paolo

>
> Ciao,
> Paolo
>
>
>
>> 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:25:15 PDT 2025

Total time taken to generate the page: 0.00373 seconds