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

Home » Public Forums » archive » Re: pixel coordinates of a line
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: pixel coordinates of a line [message #25544 is a reply to message #25543] Thu, 28 June 2001 05:43 Go to previous messageGo to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Marc Schellens wrote:

> I want to extract pixels along a line.
> I know start and endpoint (ie. I draw the line in top of the
> image).
> How to get the pixel values? Do I have to do it 'by hand'?

Good question. I don't know about such a function in IDL, but I think
there should be a routine for that.

What about this:
Your line runs from (x1,y1) to (x2,y2), the image has a size of
dimx*dimy. Let's create a thin, one pixel wide polygon along this line:
index = polyfillv( [x1,x2,x2+1,x1+1], [y1,y2,y2,y1], dimx, dimy )
(This assumes that |x2-x1| lt |y2-y1|).
Your pixel values are image[index] then. Well, nearly.

Another method would be drawing a real line via PLOTS (preferably in the
Z buffer), use TVRD() to get this screen part, use WHERE() to get the
indices of this line, and again image[index] is the information you
seek.

But let's wait a little for other responses, I'm pretty sure J.D. will
come up with another idea involving HISTOGRAM().

Alex
--
Alex Schuster Wonko@planet-interkom.de
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: volume slicing
Next Topic: Re: Intersecting geometric shapes

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

Current Time: Fri Oct 10 16:02:32 PDT 2025

Total time taken to generate the page: 1.04254 seconds