Actually I just got it to work by changing the following line in your example<div><br></div><div>int pickSucceeded = panel.getPicker().Pick(e.getX(), panel.getRenWin().getHeight()-e.getY()-1, 0, panel.getRenWin().GetRenderer());</div>
<div><br></div><div>int pickSucceeded = panel.getPicker().Pick(e.getX(), panel.getRenWin().getHeight()-e.getY()-1, 0, panel.getImageViewer().GetRenderer());</div><div><br></div><div>Basically by referencing the image viewer's renderer instead of the vtkCanvas' render it works correctly.</div>
<div><br></div><div>Thanks again<br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 8:52 PM, Jonathan Morra <span dir="ltr"><<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I just played around with this and it works great in one of my views and not so great in the other 2.<div><br></div><div>I have an app with 3 vtkImageViewer2's, one in each orthogonal plane. In the XY plane this works perfectly. However, in the XZ plane and YZ plane it doesn't work so good.</div>
<div><br></div><div>Any ideas?<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 7:45 PM, Jonathan Morra <span dir="ltr"><<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the help, I'll have a look at those examples.<div><div></div><div><br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 7:37 PM, <a href="mailto:egk865@yahoo.com" target="_blank">egk865@yahoo.com</a> <span dir="ltr"><<a href="mailto:egk865@yahoo.com" target="_blank">egk865@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can get mouse information by adding a mouse listener on the vtkCanvas<br>
to listen to mouse events. I added an example on the wiki showing how to<br>
do this (see the Swing Integration section there). It shows in a JLabel in<br>
the status bar the point the mouse is hovering over using a mouse listener<br>
and a vtkCellPicker.<br>
<br>
Thanks,<br>
Eli<br>
<div><br>
<br>
> OK, so maybe my last email wasn't<br>
> specific enough, so here's a very specific<br>
> question. I have a vtkCanvas onto which I put a<br>
> vtkImageViewer2. I wish to<br>
> have crosshairs show on the image where the user<br>
> clicks. I also wish to get<br>
> the point clicked information during the mouse event so<br>
> that I can display<br>
> that to the user in a JLabel. Any ideas?<br>
><br>
> Thanks<br>
<br>
<br>
<br>
<br>
</div><div><div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>