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

Home » Public Forums » archive » extracting pixel coordinates
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
extracting pixel coordinates [message #94489] Mon, 12 June 2017 04:10 Go to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
Hi all,
I have a 1000 by 1000 pixel array, I need to extract a 1D column
whose start point is (401,642)
and end point is (411,750)
anybody have some idea on this.
thanks
Re: extracting pixel coordinates [message #94490 is a reply to message #94489] Mon, 12 June 2017 05:12 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
How about this?

data = fltarr(1000,1000)
subdata = data[401:411, 642:750]
subdata = reform( subdata, 1, n_elements(subdata) )
help, subdata
Re: extracting pixel coordinates [message #94491 is a reply to message #94489] Mon, 12 June 2017 05:19 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
On Monday, June 12, 2017 at 7:10:47 AM UTC-4, sid wrote:
> Hi all,
> I have a 1000 by 1000 pixel array, I need to extract a 1D column
> whose start point is (401,642)
> and end point is (411,750)
> anybody have some idea on this.
> thanks

I am not sure what do you want. If you want to select the values from the start point to the end point (straight line) you could try this:

xsel=[401:642]
ysel=[411:750]

The problem here is that the selecttion on X does not have the same number of elements as Y, you should therefore interpolate:

xsel=congrid(xsel,n_elements(ysel),/int,/center,/minus_one)

And the result would be:

result=you_array(xsel,ysel)
Re: extracting pixel coordinates [message #94492 is a reply to message #94489] Mon, 12 June 2017 08:16 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Monday, June 12, 2017 at 1:10:47 PM UTC+2, sid wrote:
> Hi all,
> I have a 1000 by 1000 pixel array, I need to extract a 1D column
> whose start point is (401,642)
> and end point is (411,750)
> anybody have some idea on this.
> thanks

I'm also not sure what you would like to do, but I wrote a pro some time ago to calculate line profiles. Not only for lines, but also for polylines. Here is the link:
http://idl.marchetto.de/getting-line-profiles/

David also wrote something like this:
http://www.idlcoyote.com/ip_tips/image_profile.html

Cheers,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Define a region between curves
Next Topic: Download previous versions of IDL

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

Current Time: Wed Oct 08 15:12:33 PDT 2025

Total time taken to generate the page: 0.00471 seconds