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

Home » Public Forums » archive » Re: 3D-coordinates of index returned MAX()
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: 3D-coordinates of index returned MAX() [message #34698 is a reply to message #34697] Sun, 06 April 2003 13:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Alexander Gro� (AlexanderGross_NOSPAM@gmx.de) writes:

> I have problems determining the coordinates from the index returned by
> MAX(). The online help has an example for that in 2D, but I need a solution
> for 3D-space.
>
> What tells me this index? Is something like the pixelnumber in the whole
> 3D-array? How is this array referenced through the index?
>
> The code looks like this:
> nXCoord = nMaxIndex mod size_imgRef_x
> nYCoord = nMaxIndex / (size_imgRef_x * size_imgRef_z)
> nZCoord = nMaxIndex / (size_imgRef_x * size_imgRef_y)
>
> It does not work for me. Am I just to blind/stupid to see the solution or is
> there some difference between 2D and 3D.
>
> Best regards and thanks for your help in advance,

Your Y index is wrong. It should be:

nYCoord = (nMaxIndex/size/imgRef_x) MOD size_imgRef_y

Here is a reference:

http://www.dfanning.com/tips/where_to_2d.html

Cheers,

David


--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL objected oriented question
Next Topic: how to create .exe

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

Current Time: Wed Oct 08 17:34:23 PDT 2025

Total time taken to generate the page: 0.00480 seconds