[vtkusers] vtkPointPicker returning wrong coords
Jonathan Ruiz Peinado
jonathan.ruiz3 at gmail.com
Tue May 29 07:23:38 EDT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120529/705669aa/attachment.htm>
More information about the vtkusers
mailing list