Logarithmic Color Scaling [message #51718] |
Tue, 05 December 2006 07:16 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I'm embarrassed to admit this, but I spent the entire day
yesterday working on a logarithmic color scaling problem
and got absolutely nowhere. I was really counting on a
breakthrough in the shower this morning, but no joy there,
either. :-(
My dilemma is this. I can produce a log scaled image
(using LOGSCL) and I can create a log scaled color table
(again using LOGSCL with the method Lagos outlined yesterday).
What I cannot do is associate a color on the color bar
with the actual image value.
In other words, when I click on the image, I can read that
value back from the image. The value of that pixel does
not correspond to the color representing that value
in the color table. In fact, it is not even close. It is
so far off, in fact, that it makes me think there is something
absolutely fundamental that I am not understanding about the
problem.
I have thought about nothing else for 24 hours and can't
see my way out of this problem. (Although a bulky furnace
is going to demand some of my time today.) Has anyone
EVER done this successfully? Could you show me a bit of
code?
I want to show a data set with values extending over
several decades with a logarithmic color bar. The
data set I am using is this one:
image = FltArr(400, 400)
image[30:40, 30:40] = 10
image[50:60, 50:60] = 100
image[70:80, 70:80] = 1000
image[90:100, 90:100] = 2500
image[110:120, 110:120] = 3500
image[130:140, 130:140] = 5000
image[150:160, 150:160] = 7500
image[170:180, 170:180] = 10000
I can show this data set logarithmically scaled:
LoadCT, 33
TV, LogScl(image)
And I can even show the logarithmically scaled
color values that accurately reflects the image
values:
TVLCT, r, g, b, /GET
TVLCT, r[LogScl(index)], g[LogScl(index)], b[LogScl(index)]
Colorbar, range=[1,10000]
What I cannot show is a Colorbar with a logarithmic axis scale
that accurately shows the image colors. :-(
Colorbar, Range=[1,10000], XLOG=1, XTICKS=0, MINOR=5
I am VERY open to ideas. :-)
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.")
|
|
|