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

Home » Public Forums » archive » Re: Quick question regarding "where" function
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: Quick question regarding "where" function [message #45825] Wed, 12 October 2005 14:41 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1129151161.183821.264480@g14g2000cwa.googlegroups.com>,
"ChiChiRuiz@gmail.com" <ChiChiRuiz@gmail.com> wrote:

> I have an image of pixels (xsize by ysize), each pixel is associated
> with a value. Say I'd like to know which pixels have value over 20. I
> need to book-keep the values as well as the location of the pixel (i.e.
> x, y values). I started with
>
> indices = where (image GT 20)
>
> now I have a list of indices, what do i do next? How do I go backwards
> to retrieve the values and the locations of the pixels that pass the
> test?
>
> thanks for your help.

values = image[indices]
locations = ARRAY_INDICES[image, indices]


But never do a WHERE without a count and subsequent IF

indices = WHERE(image GT 20, count)
IF (count GT 0) THEN ...


Cheers, Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: newbie: sub-array extraction
Next Topic: Re: lighting /ALIASed models

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

Current Time: Wed Oct 08 17:02:37 PDT 2025

Total time taken to generate the page: 0.00549 seconds