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

Home » Public Forums » archive » Re: Displaying overlay planes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Displaying overlay planes [message #15659] Wed, 02 June 1999 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Daniel Peduzzi wrote:>
> The answer to this question has eluded me for some time now, and I'm wondering
> if some kind IDL guru could point me in the right direction.
>
> I have an 8-bit image (satellite data) which is being displayed on a 24-bit
> system. I'm currently using
>
> device, true_color=24, decomposed=0
>
> to do this, since I have the 8-bit image and corresponding r-g-b arrays.
>
> I also have some bitplane data, in another 8-bit 2D array, where each of
> the 8 bitplanes correspond to a cloud type. (For example, any pixel containing
> cirrus would have a bit set in plane number 5.)
>
> What I would like to do is to display any one of these 8 masks, in its own distinct
> color, over the original satellite data. I don't need to see the underlying imagery,
> so a solid color would be fine, but I do need the capability of toggling the mask on
> and off with reasonable speed (less than a second.)

Dan,

Regarding the ability to toggling the mask on and off, I recommend
trying my frame tools. These provide a way to create an IDL graphics
window that has a built-in number of 'frames'. For example, you could
display the image only in frame 0, then the image with mask overlay in
frame 1, and then loop between frames 0 and 1 with whatever delay time
you like. The graphics window otherwise works just like a normal IDL
graphics window. Check it out at

http://cimss.ssec.wisc.edu/~gumley/frame.html

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
Re: Displaying overlay planes [message #15664 is a reply to message #15659] Tue, 01 June 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Daniel Peduzzi (peduzzi@mediaone.net) writes:

> The answer to this question has eluded me for some time now, and I'm wondering
> if some kind IDL guru could point me in the right direction.
>
> I have an 8-bit image (satellite data) which is being displayed on a 24-bit
> system. I'm currently using
>
> device, true_color=24, decomposed=0
>
> to do this, since I have the 8-bit image and corresponding r-g-b arrays.
>
> I also have some bitplane data, in another 8-bit 2D array, where each of
> the 8 bitplanes correspond to a cloud type. (For example, any pixel containing
> cirrus would have a bit set in plane number 5.)
>
> What I would like to do is to display any one of these 8 masks, in its own distinct
> color, over the original satellite data. I don't need to see the underlying imagery,
> so a solid color would be fine, but I do need the capability of toggling the mask on
> and off with reasonable speed (less than a second.)
>
> Is this possible using IDL?

Oh, *anything* is possible using IDL! :-)

Here is a quick and dirty program named CLOUD that does
what you ask for. I didn't spend more than 15 minutes on
it, I don't think. It does make use of some of my programs
that you can find on my web page:

http://www.dfanning.com/programs/loaddata.pro
http://www.dfanning.com/programs/tvimage.pro

If I were really going to do this, however, I don't think
I would do it this way. I would probably have a closer look
at the program IMAGE_BLEND and use the alpha blending function
available to object graphics images.

http://www.dfanning.com/programs/image_blend.pro

I think it would be nicer to see through the clouds. :-)

I'm sorry the cloud images aren't nicer, but I didn't
want my wife to catch me working on this. I was suppose
to be folding laundry. :-(

Cheers,

David

**************Cut Here ><))****************************

PRO Cloud_Off, event
Widget_Control, event.top, Get_UValue=info, /No_Copy

; Display image.

WSet, info.wid
TVImage, info.image

Widget_Control, event.top, Set_UValue=info, /No_Copy
END ;----------------------------------------------------------



PRO Cloud_Button_Events, event
Widget_Control, event.top, Get_UValue=info, /No_Copy

; Get button value, which is equivalent to bit.

Widget_Control, event.id, Get_Value=buttonValue
buttonValue = Fix(buttonValue)

; Copy of image.

image = info.image

; Make cloud bits a particular color.

image[Where((info.cloud AND 2^buttonValue) GT 0)] $
= 241 + buttonValue

; Display image.

WSet, info.wid
TVImage, image

Widget_Control, event.top, Set_UValue=info, /No_Copy
END ;-----------------------------------------------------------



PRO CLOUD
Device, Decomposed=0

; Create some fake cloud data.

image = Loaddata(18)
cloud = BytArr(400,400)
FOR j=0,7 DO BEGIN
index = Where(image GE 2^j AND image LT 2^(j+1))
cloud[index] = 2^j
ENDFOR

; Get an image.

image = LoadData(7)
image = Congrid(image, 400, 400)
image = BytScl(image, Top=240)

; Load some colors.

LoadCT, 0, NColors=241
LoadCT, 33, NColors=8, Bottom=241

; Create some widgets.

tlb = Widget_Base(Row=1)
butBaseID = Widget_Base(tlb, Column=1, $
Event_Pro='Cloud_Button_Events')
label = Widget_Label(butBaseID, Value=' Select Cloud Bit ')
FOR j=0,7 DO $
button = Widget_Button(butBaseID, Value=StrTrim(j))
button = Widget_Button(butBaseID, Value='Clouds OFF', $
Event_Pro='Cloud_Off')
drawID = Widget_Draw(tlb, XSize=500, YSize=500)
Widget_Control, tlb, /Realize
Widget_Control, drawID, Get_Value=wid
WSet, wid
TVImage, image

info = {wid:wid, image:image, cloud:cloud}
Widget_Control, tlb, Set_UValue=info, /No_Copy
XManager, 'cloud', tlb, /No_Block
END ;----------------------------------------------------------




--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PV-Wave plotting adventures
Next Topic: ENVI Raster editing Problem

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

Current Time: Wed Oct 08 19:53:37 PDT 2025

Total time taken to generate the page: 0.00462 seconds