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

Home » Public Forums » archive » Re: Line index
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Line index [message #5957] Fri, 22 March 1996 00:00
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
pit@asterix.kis.uni-freiburg.de (Peter Suetterlin) wrote:
>
> In article <31499FB9.2F6D@dlr.de>,
> Hermann Mannstein <H.Mannstein@dlr.de> writes:
>
>> is there a robust function which returns the indices within an image
>> (like the where function) belonging to a line defined by two or more
>> points.
>
> for shure there is, even built-in IDL:
> Index=polyfillv(xx,yy,xsize,ysize)
> Read the manpage for further reference.
>

According to the "manpage", POLLYFILLV() expects at least 3
points so it would never work for a simple line. Also, it
connects each successive line and the first with the last,
to make a polygon, and then returns the indices of the
points within this polygon.

You wouldn't be getting the indices of the points on the line(s),
but of the points within the polygon defined by the points.

Dave Foster
foster@bial1.ucsd.edu
Re: Line index [message #5959 is a reply to message #5957] Fri, 22 March 1996 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Hermann Mannstein <H.Mannstein@dlr.de> wrote:
>
> Hello,
> is there a robust function which returns the indices within an image
> (like the where function)
> belonging to a line defined by two or more points.

I don't have a function, but I can suggest a possible solution.
Given your two points, if you use the familiar Y = mX + B formula
to calculate the (X,Y) coordinate pairs for either each X or for
each Y along the "span" of the line (use the one that gives you
more points), and then convert these pairs to one-dimensional
indices using the formula

Indices = ( Y_coors * Xdim ) + X_coors

where the "image" is Xdim x Ydim. Obviously you'll have to do
some checking to make sure the points are within the image.

Hope this is useful.

Dave Foster
foster@bial1.ucsd.edu
Re: Line index [message #5989 is a reply to message #5957] Fri, 15 March 1996 00:00 Go to previous message
pit is currently offline  pit
Messages: 92
Registered: January 1996
Member
In article <31499FB9.2F6D@dlr.de>,
Hermann Mannstein <H.Mannstein@dlr.de> writes:
> Hello,

> is there a robust function which returns the indices within an image
> (like the where function) belonging to a line defined by two or more
> points.

for shure there is, even built-in IDL:
Index=polyfillv(xx,yy,xsize,ysize)
will give you the indices of the indices of the points surrounded by
the polygon given in the two vectors xx and yy for the x and y
coordinates, resp.
Read the manpage for further reference.

Peter


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.kis.uni-freiburg.de/~ps
Kiepenheuer Institut fuer Sonnenphysik
Tel.: +49 761 3198-210 ps@kis.uni-freiburg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V.
Tel.: +49 761 73571 or 278588
____________________________________________________________ ______________
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Fun Stuff: A widget map browser
Next Topic: Re: [Q]IDL: Using WHERE.

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

Current Time: Wed Oct 08 15:10:55 PDT 2025

Total time taken to generate the page: 0.00816 seconds