comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » how to set density slice color using the IDL new graphic
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
how to set density slice color using the IDL new graphic [message #85919] Wed, 18 September 2013 06:12 Go to previous message
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
Hi all,
I'm trying to create a widget where after reading an image it appears and clicking on a butt from gray scale it would turn in an image with only 5 colors one fore each class I have in the image.
the image is a gray scale byte array[600,600] where the pixels have this values=63, 127,191,254,0

I would like to associate a specific color to each of these values


with the old graphic system I did in this way:

PRO read_tiff_widget_density_slice,event
WIDGET_CONTROL,event.top, GET_UVALUE=status

LoadCT, 0, NColors=254
;; example: 255, 0, 0, 255 ; Red in index 255


DEVICE, DECOMPOSED=0
white=WHERE(status.img EQ 63, count)
IF count NE 0 THEN BEGIN
TVLCT,255,255,255, 63
status.img[white]=63
ENDIF


green=WHERE(status.img EQ 127, count)
IF count NE 0 THEN BEGIN
; print, 'count green', count
TVLCT,0,255,0, 127
status.img[green]=127
ENDIF
...
...
...
(the same for all the values)

TV,status.img
WIDGET_CONTROL, event.top, SET_UVALUE=status

END



and the "status" variable is defined as follows:
where "img" is the image
status={fname_map:fname_map,$
map_name_field:map_name_field,$
img:img,$
lon:lon,$
lat:lat}


If I try to use the same approach with the new graphic it does not work anymore and I'm not able to find a workaround.

I hope my problem is clear..

do you have any suggestions??
thanks in advance

cheers
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Trying to plot geomagnetic coordinates
Next Topic: Extracting plot boundaries

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:22:36 PDT 2025

Total time taken to generate the page: 0.00365 seconds