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

Home » Public Forums » archive » 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: WHERE Function [message #4239 is a reply to message #4152] Thu, 11 May 1995 00:00 Go to previous messageGo to previous message
chris is currently offline  chris
Messages: 22
Registered: October 1994
Junior Member
PRYHODA (bjp8350@osfmail.isc.rit.edu) wrote:
: I am using the WHERE function to return the pixel locations of a single object
: in a binary image. The WHERE function returns a LONGWORD VECTOR that can be
: used to subscript the image array. I need to calculate the distance between
: each combination of border pixels to find the object's major axis.

: How can I seperate the LONGWORD VECTOR into its X and Y components? so I can
: use the distance formula. Or is there an easier way to find the distance
: between each pixel?

There is probably an easier way, but here's how you can find x and y.

Nx = 4 & Ny = 10 ; Dimensions of the Array
im = findgen(Nx) # findgen(Ny) ; Make an arbitrary array.
w = where( im eq 27) ; w = longword type
x = w mod Nx
y = w / Nx
print, im(x,y) ; check: should = 27.

You might consider playing with the dist(_) function, or with
shift.

-chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: where function
Next Topic: Need help with map projection conversion in ENVI

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

Current Time: Wed Oct 08 19:35:33 PDT 2025

Total time taken to generate the page: 0.00442 seconds