[vtkusers] vtkPointPicker returning wrong coords

Jothybasu Selvaraj jothybasu at gmail.com
Tue May 29 07:51:42 EDT 2012


Are you using vtkImageChangeInformation?

Jothy

On Tue, May 29, 2012 at 12:23 PM, Jonathan Ruiz Peinado <
jonathan.ruiz3 at gmail.com> wrote:

> Hi, I'm picking the a point location using vtkPointPicker, everything was
> working well until I changed the origin of the source image as I'm showing
> below:
>
> normalized.SetInputConnection( reader.GetOutputPort() );
> ****normalized.SetOutputOrigin(0.0, 0.0, 0.0);*****
> normalized.SetOutputSpacing( spacing[0], spacing[1], ippzspacing );
> normalized.Update();
>
> Point picker is ignoring this new origin and is giving same cords as
> before, using the centre of the image as the origin instead of use
> the right top corner.
>
> double[] axialMapperPosition = new double[4];
>  mouseXYAxial = e.getPoint();
>  vtkPointPicker pickerAxial = new vtkPointPicker();
>
>  int pickTest = pickerAxial.Pick(mouseXYAxial.x, mouseXYAxial.y, 0.0,
> vtkPanel.GetRenderer());
>
> if (pickTest != 0) {
>           axialMapperPosition = pickerAxial.GetMapperPosition();         ;
>           System.out.println(" x:"+axialMapperPosition[0] + "
> y:"+axialMapperPosition[1] + " z:" +axialMapperPosition[2]);
>
> }
>
> what I'm missing here?
>
> Thanks
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120529/4cb9778a/attachment.htm>


More information about the vtkusers mailing list