Re: Quick question regarding "where" function [message #45825] |
Wed, 12 October 2005 14:41  |
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
|
|
|
|
|