Re: IDL 8 image function [message #74762] |
Wed, 02 February 2011 11:20  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Feb 2, 3:35 pm, sh <sebastian.h...@gmail.com> wrote:
> Ok this error message comes if RGB_TABLE is not specified within the
> image()
>
> Now the only problem left is to rescale the colorbar from 0 to 255 to
> the dataspace
I had a feeling I had done this before. As it turns out, I did:
http://www.ppenteado.net/idl/pp_lib/doc/pp_colorbar_range.ht ml
It was written back in the days of the iTools, but it seems to work
the same with Graphics.
|
|
|
Re: IDL 8 image function [message #74770 is a reply to message #74762] |
Wed, 02 February 2011 09:35   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 6:00 pm, David Fanning <n...@dfanning.com> wrote:
> Paul van Delst writes:
>> You mean "cgImage" and "cgColorbar" don't you?
>
> Yes, but I haven't checked those in yet. I'm pretty sure
> the book is OK, and the Library is fine. But just the thought
> of all those broken links on my web page is giving me
> heartburn this morning. :-(
>
> I've got to get to it, but my "final" list is getting
> longer, not shorter... Aaauughhhh!
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Ok this error message comes if RGB_TABLE is not specified within the
image()
Now the only problem left is to rescale the colorbar from 0 to 255 to
the dataspace
|
|
|
|
Re: IDL 8 image function [message #74772 is a reply to message #74771] |
Wed, 02 February 2011 08:51   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 5:35 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> David Fanning wrote:
>> sh writes:
>
>> I don't want to intrude on a discussion of function graphics,
>> which I don't know much about, but all this is *easily* done,
>> resizeable windows and all, with TVImage and FSC_Colorbar
>> from the Coyote Graphics routines. :-)
>
> You mean "cgImage" and "cgColorbar" don't you?
>
> :o)
>
> cheers,
>
> paulv
>
> p.s. c.l.i-p lurkers and new readers, please refer to the "Time to Fish or Cut Bait" thread so my remark doesn't cause
> undue confusion..... :o)
Ok. RGBA works properly, but colorbar sometimes says:
% Loaded DLM: XML.
% Unable to create colorbar
and if it works it is scaled between 0 and 255. I guess I need to
rescale it somehow?
Anyone has a clue?
|
|
|
|
|
Re: IDL 8 image function [message #74776 is a reply to message #74775] |
Wed, 02 February 2011 08:11   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 4:51 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 2, 1:30 pm, sh <sebastian.h...@gmail.com> wrote:
>
>
>
>> On Feb 2, 2:31 pm, sh <sebastian.h...@gmail.com> wrote:
>
>>> On Feb 2, 12:44 pm, sh <sebastian.h...@gmail.com> wrote:
>
>>>> On Feb 2, 11:44 am, David Forcadell <david...@gmail.com> wrote:
>
>>>> > On Feb 2, 11:02 am, sh <sebastian.h...@gmail.com> wrote:
>
>>>> > > Hi,
>
>>>> > > Is there any option/keyword to turn of the scaling between 0-255? I
>>>> > > have already scaled by values e.g. between 0 and 100 because I only
>>>> > > want to use this colors in the colortable, and not all of them!
>>>> > > Thanks!
>
>>>> > > Sebastian
>
>>>> > I am not sure that i understand you question, but perhaps you want
>>>> > this :
>
>>>> > result=BYTSCL( MAT_IN , TOP=100)
>
>>>> Yes I do it exactly like this, but image() rescales it again between 0
>>>> and 255. How to turn this off?
>
>>> Another question, is there any possiblity to set a background value
>>> like NaN in iimage?
>
>>> All NaN values are transformed to 0 after bytscl?
>
>> Ok I think I found the problem. Within idlitvisimage__define.pro in
>> line 1801 there is the bytscl, without the possibility to turn it off.
>
>> Would be nice to specify the top and bottom or even turn it off if the
>> data is already scaled.
>
>> Then the next think is the colorbar which didn't match when I update
>> line 1801 with top and bottom.
>
> If I understand this right, you can to map your data into RGB, and
> give image() a 3 channel image, which it will display as it is. If you
> do that, you can also make it a 4 channel image, with the alpha
> (transparency) channel determined by the presence of NaNs, to make
> NaNs transparent.
I already tried an RGB image. Indeed it works for the image but since
I would like to use the first color as a background value the colorbar
has it included!
Maybe it will work with RGBA, I'll try that.
Thanks David, but yours is direct graphics and I would like to play
around with the new graphics instead using your graphics as usual ;)
|
|
|
Re: IDL 8 image function [message #74778 is a reply to message #74776] |
Wed, 02 February 2011 07:51   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Feb 2, 1:30 pm, sh <sebastian.h...@gmail.com> wrote:
> On Feb 2, 2:31 pm, sh <sebastian.h...@gmail.com> wrote:
>
>
>
>
>
>> On Feb 2, 12:44 pm, sh <sebastian.h...@gmail.com> wrote:
>
>>> On Feb 2, 11:44 am, David Forcadell <david...@gmail.com> wrote:
>
>>>> On Feb 2, 11:02 am, sh <sebastian.h...@gmail.com> wrote:
>
>>>> > Hi,
>
>>>> > Is there any option/keyword to turn of the scaling between 0-255? I
>>>> > have already scaled by values e.g. between 0 and 100 because I only
>>>> > want to use this colors in the colortable, and not all of them!
>>>> > Thanks!
>
>>>> > Sebastian
>
>>>> I am not sure that i understand you question, but perhaps you want
>>>> this :
>
>>>> result=BYTSCL( MAT_IN , TOP=100)
>
>>> Yes I do it exactly like this, but image() rescales it again between 0
>>> and 255. How to turn this off?
>
>> Another question, is there any possiblity to set a background value
>> like NaN in iimage?
>
>> All NaN values are transformed to 0 after bytscl?
>
> Ok I think I found the problem. Within idlitvisimage__define.pro in
> line 1801 there is the bytscl, without the possibility to turn it off.
>
> Would be nice to specify the top and bottom or even turn it off if the
> data is already scaled.
>
> Then the next think is the colorbar which didn't match when I update
> line 1801 with top and bottom.
If I understand this right, you can to map your data into RGB, and
give image() a 3 channel image, which it will display as it is. If you
do that, you can also make it a 4 channel image, with the alpha
(transparency) channel determined by the presence of NaNs, to make
NaNs transparent.
|
|
|
|
Re: IDL 8 image function [message #74780 is a reply to message #74779] |
Wed, 02 February 2011 07:30   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 2:31 pm, sh <sebastian.h...@gmail.com> wrote:
> On Feb 2, 12:44 pm, sh <sebastian.h...@gmail.com> wrote:
>
>
>
>> On Feb 2, 11:44 am, David Forcadell <david...@gmail.com> wrote:
>
>>> On Feb 2, 11:02 am, sh <sebastian.h...@gmail.com> wrote:
>
>>>> Hi,
>
>>>> Is there any option/keyword to turn of the scaling between 0-255? I
>>>> have already scaled by values e.g. between 0 and 100 because I only
>>>> want to use this colors in the colortable, and not all of them!
>>>> Thanks!
>
>>>> Sebastian
>
>>> I am not sure that i understand you question, but perhaps you want
>>> this :
>
>>> result=BYTSCL( MAT_IN , TOP=100)
>
>> Yes I do it exactly like this, but image() rescales it again between 0
>> and 255. How to turn this off?
>
> Another question, is there any possiblity to set a background value
> like NaN in iimage?
>
> All NaN values are transformed to 0 after bytscl?
Ok I think I found the problem. Within idlitvisimage__define.pro in
line 1801 there is the bytscl, without the possibility to turn it off.
Would be nice to specify the top and bottom or even turn it off if the
data is already scaled.
Then the next think is the colorbar which didn't match when I update
line 1801 with top and bottom.
|
|
|
Re: IDL 8 image function [message #74783 is a reply to message #74780] |
Wed, 02 February 2011 05:31   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 12:44 pm, sh <sebastian.h...@gmail.com> wrote:
> On Feb 2, 11:44 am, David Forcadell <david...@gmail.com> wrote:
>
>> On Feb 2, 11:02 am, sh <sebastian.h...@gmail.com> wrote:
>
>>> Hi,
>
>>> Is there any option/keyword to turn of the scaling between 0-255? I
>>> have already scaled by values e.g. between 0 and 100 because I only
>>> want to use this colors in the colortable, and not all of them!
>>> Thanks!
>
>>> Sebastian
>
>> I am not sure that i understand you question, but perhaps you want
>> this :
>
>> result=BYTSCL( MAT_IN , TOP=100)
>
> Yes I do it exactly like this, but image() rescales it again between 0
> and 255. How to turn this off?
Another question, is there any possiblity to set a background value
like NaN in iimage?
All NaN values are transformed to 0 after bytscl?
|
|
|
Re: IDL 8 image function [message #74786 is a reply to message #74783] |
Wed, 02 February 2011 03:44   |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 11:44 am, David Forcadell <david...@gmail.com> wrote:
> On Feb 2, 11:02 am, sh <sebastian.h...@gmail.com> wrote:
>
>> Hi,
>
>> Is there any option/keyword to turn of the scaling between 0-255? I
>> have already scaled by values e.g. between 0 and 100 because I only
>> want to use this colors in the colortable, and not all of them!
>> Thanks!
>
>> Sebastian
>
> I am not sure that i understand you question, but perhaps you want
> this :
>
> result=BYTSCL( MAT_IN , TOP=100)
Yes I do it exactly like this, but image() rescales it again between 0
and 255. How to turn this off?
|
|
|
|
Re: IDL 8 image function [message #74829 is a reply to message #74762] |
Thu, 03 February 2011 00:28  |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 8:20 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 2, 3:35 pm, sh <sebastian.h...@gmail.com> wrote:
>
>> Ok this error message comes if RGB_TABLE is not specified within the
>> image()
>
>> Now the only problem left is to rescale the colorbar from 0 to 255 to
>> the dataspace
>
> I had a feeling I had done this before. As it turns out, I did:
>
> http://www.ppenteado.net/idl/pp_lib/doc/pp_colorbar_range.ht ml
>
> It was written back in the days of the iTools, but it seems to work
> the same with Graphics.
Thanks!! I have already a workaround for this ;)
I create a hidden image with the MY max and min values, and then use
the colorbar function on this hidden image "overlay".
ov_im=image([[minv,minv],[maxv,maxv]],/HIDE,/OVERPLOT)
c = COLORBAR(TARGET=ov_im)
It works fine with an RBGA image in the beginning, which I have scaled
myself with BYTSCL.
Unfortunately the colorbar uses always 256 colors/values, so when I
want to use only index from 0 to 100, the rest is black.
I'm playing around now with the 'IDLgrPalette', maybe I can convince
IDL to use only the number of colors specified there.
|
|
|
Re: IDL 8 image function [message #74830 is a reply to message #74762] |
Thu, 03 February 2011 00:28  |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 8:20 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 2, 3:35 pm, sh <sebastian.h...@gmail.com> wrote:
>
>> Ok this error message comes if RGB_TABLE is not specified within the
>> image()
>
>> Now the only problem left is to rescale the colorbar from 0 to 255 to
>> the dataspace
>
> I had a feeling I had done this before. As it turns out, I did:
>
> http://www.ppenteado.net/idl/pp_lib/doc/pp_colorbar_range.ht ml
>
> It was written back in the days of the iTools, but it seems to work
> the same with Graphics.
Thanks!! I have already a workaround for this ;)
I create a hidden image with the MY max and min values, and then use
the colorbar function on this hidden image "overlay".
ov_im=image([[minv,minv],[maxv,maxv]],/HIDE,/OVERPLOT)
c = COLORBAR(TARGET=ov_im)
It works fine with an RBGA image in the beginning, which I have scaled
myself with BYTSCL.
Unfortunately the colorbar uses always 256 colors/values, so when I
want to use only index from 0 to 100, the rest is black.
I'm playing around now with the 'IDLgrPalette', maybe I can convince
IDL to use only the number of colors specified there.
|
|
|
Re: IDL 8 image function [message #74831 is a reply to message #74762] |
Thu, 03 February 2011 00:28  |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
On Feb 2, 8:20 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 2, 3:35 pm, sh <sebastian.h...@gmail.com> wrote:
>
>> Ok this error message comes if RGB_TABLE is not specified within the
>> image()
>
>> Now the only problem left is to rescale the colorbar from 0 to 255 to
>> the dataspace
>
> I had a feeling I had done this before. As it turns out, I did:
>
> http://www.ppenteado.net/idl/pp_lib/doc/pp_colorbar_range.ht ml
>
> It was written back in the days of the iTools, but it seems to work
> the same with Graphics.
Thanks!! I have already a workaround for this ;)
I create a hidden image with the MY max and min values, and then use
the colorbar function on this hidden image "overlay".
ov_im=image([[minv,minv],[maxv,maxv]],/HIDE,/OVERPLOT)
c = COLORBAR(TARGET=ov_im)
It works fine with an RBGA image in the beginning, which I have scaled
myself with BYTSCL.
Unfortunately the colorbar uses always 256 colors/values, so when I
want to use only index from 0 to 100, the rest is black.
I'm playing around now with the 'IDLgrPalette', maybe I can convince
IDL to use only the number of colors specified there.
|
|
|