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

Home » Public Forums » archive » Re: color pixel by index
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: color pixel by index [message #55957 is a reply to message #55955] Mon, 24 September 2007 13:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
rpertaub@gmail.com writes:

> i think this is a fairly easy problem to which i dunno the answer.
> Here goes:
>
> I have 3 images, and used where function 3 times to find 3 specific
> characterizations.
> mask1=where(image ge thresh1)
> mask2=where(image2 ge thresh2)
> mask 3=where(image3 ge thresh3)
>
> Now I have 3 sets of indices of pixels of my interest.
>
> I want to use image 4 and color pixels indices 1 red, indices 2= blue,
> indices 3=green.
>
> image[indices1]=red
> image[indices2]=blue
> image[indices3]=green
>
> How do I do that?

I would do it like this, since you may want to
see the overlap in the indices:


s = Size(image, /Dimensions)
nelem = N_Elements(image)
image4 = BytArr(s[0], s[1], 3]
image4[mask1] = 255B
image4[mask3 + nelem] = 255B
image4[mask2 + (nelem*2)] = 255B
TV, image4, True=3

This presumes all three image used to construct the masks
are the same size.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ITK and IDL interface
Next Topic: Mosaic_doit

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

Current Time: Sat Oct 11 19:05:03 PDT 2025

Total time taken to generate the page: 2.16039 seconds