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

Home » Public Forums » archive » Re: How to find the pixel position
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: How to find the pixel position [message #70636 is a reply to message #70632] Mon, 26 April 2010 23:26 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Apr 27, 1:16 am, sid <gunvicsi...@gmail.com> wrote:
> Hi,
>     My data is in fits format. The is of 1024 * 1024 array. The counts
> vary from 5000 to 6000 and I know that 5500 counts is there in my
> data, but I need to know at which pixel this 5500 counts occur
> exactly, without displaying the image, because I need to do this for
> several files. So each time I can't display and check for the pixel
> position. please helpout in this regard.
> regards

Have you tried WHERE()?
wh = where(IMG EQ 5500)

The pixel position, or position*s* if there more than one, are stored
in the index array WH. This index array addresses the 2-d array as a
1-d array. If you want the X and Y positions separately, then use the
quotient and remainder after dividing by image width...

;; SIZE_X = 1024
ix = wh MOD SIZE_X ;; Remainder
iy = wh / SIZE_X ;; Quotient

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL Page Downloads
Next Topic: Re: Regarding " WRITING DICOM IMAGES"

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

Current Time: Sat Oct 11 20:54:10 PDT 2025

Total time taken to generate the page: 0.79893 seconds