Well, as I see it, you are scaling the wrong quantity:
it is not the *values* of r,g,b that should be scaled,
but their *indices*... try:
ind=bindgen(256)
TVLCT, r[LogScl(ind)], g[LogScl(ind)], b[LogScl(ind)]
instead.
Ciao,
Paolo
David Fanning wrote:
> Folks,
>
> With no answers to my weekend questions about logarithmic
> color bars I'm flying blind this morning. And I seem to be
> running into theoretical difficulties. Can anyone help?
>
> Suppose I had a color table (color table 33 comes to mind)
> where each color vector had a min of 0 and a max 0f 255.
>
> IDL> Loadct, 33, /Silent
> IDL> TVLCT, r, g, b, /Get
> IDL> MinMax, r
> 0 255
> IDL> MinMax, g
> 0 255
> IDL> MinMax, b
> 0 255
>
> And suppose I also have an image that is scaled in
> the same way:
>
> IDL> image = Loaddata(7)
> IDL> MinMax, image
> 0 255
>
> And finally, suppose I have a way to scale such data
> sets in a logametric way, say a function LOGSCL.
>
> IDL> .compile LOGSCL
> Compiled module: LOGSCL.
>
> My hypothesis is that there are two ways to display this
> data "logarithmically". I can leave the color table vectors
> alone, and scale the image data. Or, I can leave the image
> alone and scale the color vectors. Either way should result
> in exactly the same display.
>
> The problem is, it doesn't. :-(
>
> Window, XSize=400, YSize=350, 0
> Loadct, 33, /Silent
> TVImage, image
>
> Window, XSize=400, YSize=350, 1
> Loadct, 33, /Silent
> TVImage, LogScl(image)
>
> Window, XSize=400, YSize=350, 2
> Loadct, 33, /Silent
> TVLCT, r, g, b, /Get
> TVLCT, LogScl(r), LogScl(g), LogScl(b)
> TVImage, image
>
> Does anyone have a good idea for why not?
>
> Cheers,
>
> David
>
> P.S. And please don't tell me there is something wrong
> with LOGSCL, as this is *not* the answer I want to
> hear. :-(
>
|