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

Home » Public Forums » archive » Re: Array Subscripting Puzzle
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Array Subscripting Puzzle [message #30785 is a reply to message #30782] Fri, 17 May 2002 11:57 Go to previous messageGo to previous message
dmarshall is currently offline  dmarshall
Messages: 23
Registered: December 1997
Junior Member
This wouldn't work anyways will it since indices references a which is a
large (800x600x3) linear array whereas r,g,b are only (800x600). (?)

You could "collapse" image down to a pseudo b/w
bwimage=image[*,*,0]+image[*,*,1]+image[*,*,2]
bwImage=reform(bwImage, /overwrite) ;make sure bwimage is 2D

Reform image so it is same as bwimage
image=reform(image,800*600,3, /overwrite)
Yellowize
image[where(bwimage GT 0),*]=[255,255,0]
Reform back
image=reform(image,800,600,3, /overwrite)

bwimage and the operations must be forced to long since you will get values
greater than 255.

Dave.
> I have the indices of something I want to draw on
> the image. Say they are the indices of the outlines
> of some continents. For example, like this:
>
> window, xsize=800, ysize=600
> map_set, /Cylindrical, position=[0,0,1,1]
> map_continents, /fill
> a = tvrd()
> indices = where(a GT 0)
>
> I want to make all the outline pixels yellow.
> I *could* do this:
>
> r = Reform((image[*,*,0]))
> g = Reform((image[*,*,1]))
> b = Reform((image[*,*,2]))
> r[indices] = 255
> g[indices] = 255
> b[indices] = 0
> image[*,*,0] = r
> image[*,*,1] = g
> image[*,*,2] = b
>
> That seems wasteful and inelegant. There must be
> a way to do this in one go. I'm sure it uses REBIN
> and REFORM, but I'm not sure in which order. :-(
>
> Can anyone help?
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ActiveX
Next Topic: sec : U Re: Carriage Return / LineFeed in Text Widget

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

Current Time: Fri Oct 10 02:00:43 PDT 2025

Total time taken to generate the page: 0.96154 seconds