<div>Ok then, divide the returned mapper position (for both x and y locs) by whatever you set the pixel spacing of the input image data to be (keep in mind your x/y spacing may be different too), add 0.5 and cast it to an integer, and then that's your real x/y coordinate in your 'raw' image.
</div>
<div>&nbsp;</div>
<div>But you have to keep in mind that your ITK image is most likely 'flipped' compared to the input&nbsp;VTK image data you are using. So if the ITK image data is a&nbsp;1D array, the actual pixel index is just:</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; nRealIdx = (ImgHeight - nRealY - 1) * (ImageWidth) + nRealX;</div>
<div>&nbsp;</div>
<div>If you're sure your ITK also has cartesian coordinates, or just the same as your VTK data,&nbsp;its just:</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; nRealIdx = nRealY * ImageWidth + nRealX;</div>
<div>&nbsp;</div>
<div>Mark<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/6/05, <b class="gmail_sendername">Renaud Isabelle</b> &lt;<a href="mailto:renauisa@yahoo.fr">renauisa@yahoo.fr</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Mark, </div>
<div>&nbsp;</div>
<div>Yes. vtkPointPicker owns 3 different functions: </div>
<div>&nbsp;</div>
<div>- <strong>GetSelectionPoint</strong> contains my (X,Y) = (Interactor-&gt;GetEventPosition()[0],&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interactor-&gt;GetEventPosition()[1])...: returns my picked point in screen coordinates
</div>
<div>&nbsp;</div>
<div>- <strong>GetMapperPosition</strong> returns the&nbsp;real coordinates&nbsp;x,y,z of my picked point, non transformed point in 3D</div>
<div>&nbsp;</div>
<div>- <strong>GetPickPosition</strong>, also a 3D position</div>
<div>&nbsp;</div>
<div>You told me to use GetMapperPosition to compute my world coordinates from a point in screen coordinates. However, that is already that I have by using GetPickPosition: in my case, both functions, GetMapperPosition and GetPickPosition, return the same result. 
<span class="q"><br><br><b><i>Mark Wyszomierski &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:markww@gmail.com" target="_blank">markww@gmail.com</a>&gt;</i></b> a écrit :</span></div>
<blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><span class="q">
<div>I don't understand:<br>&nbsp;</div>
<div>selection point (X,Y) in pixel coordinates&nbsp;&nbsp; // This is the loc picked in screen coordinates?</div></span>
<div><strong>--&gt; Yes, it is</strong></div><span class="q">
<div>real position in world (x,y,z)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This is the mapped position picked (mapped to an index in your image)?</div></span>
<div><strong>--&gt;ok, so what I would like to retrieve is the index which is mapped with my mapped position. Since index in my displayed image by VTK should be correspondant to my index in my itkImage read from a file, I could then&nbsp;get the pixel value of my itkimage at this index. Do you follow me?&nbsp;
</strong></div>
<div>&nbsp;</div>
<div>Mark</div></blockquote>
<div><span class="e" id="q_106c69ef63a2fb77_7">
<p>
<hr size="1">
<b><font color="#ff0000">Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com" target="_blank">
Téléchargez le ici !</a> 
<p></p></p></span></div></blockquote></div><br>