[vtkusers] Strange factor with vtkPointPicker

Romuald BERTRAND beromuald at wanadoo.fr
Mon Apr 28 09:12:36 EDT 2008


there is a sample of my code:

//picker = vtkPointPicker associated with vtkWindowInteractor
//clickCoords contains the coordinates of the click, return by vtkWindowInteractor
int result = picker->Pick(clickCoords[0], clickCoords[1], 0.0, renderer);

if(result)
    double *pos = picker->GetPickPosition();

Example:
Image 512*512 px
When I click on the lower-right corner, I get approximately x=229 and y=229
Multiplicate with 2.235 x=512 and y=512
(I have found 2.235 by dichotomy, with a lot of tests)

And When I click on the middle, I get approximately 115 for x and y
Multiplicate with the factor x=256 and y=256

This strange factor doesn't change with zoom, but changes for each image I test.
 
Thanks for answers.
 
 

> Message du 28/04/08 13:05
> De : "Cameron Burnett" 
> A : "Romuald BERTRAND" 
> Copie à : vtkusers at vtk.org
> Objet : RE: [vtkusers] Strange factor with vtkPointPicker
> 
>    .hmmessage P { margin:0px; padding:0px } body.hmmessage { FONT-SIZE: 10pt; FONT-FAMILY:Tahoma }  Maybe you could give an example of what you're getting at the moment, and what you're after.
> 
> I had a problem in my project where I needed to select a point for my segmentation algorithm, however I actually needed the pixel index at that coordinate rather than the actual coordinate. In order to do this I had to use image->TransformPhysicalPointToIndex(point, index). Not sure if this will help or not in your case.
> 
> Not sure if anyone could help that much with the amount of information you have given. Just send a bit more information and we can try and answer your question :).
> 
> Regards,
> Cameron. 
> 
> 
> 
> From: beromuald at wanadoo.fr
> To: vtkusers at vtk.org
> Date: Mon, 28 Apr 2008 11:58:22 +0200
> Subject: [vtkusers] Strange factor with vtkPointPicker
> 
> Hi all,
> 
> I have a problem with vtkPointPicker.
> I use this class to pick the click coords on an image, but the coords wich are picked needs to be multiplicate by a strange factor to be reals.
> Someone know why?
> and someone know how I can get this strange factor?
> Thanks a lot,
> Bye
> 

 before someone else does Find the job of your dreams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080428/d59e6f63/attachment.htm>


More information about the vtkusers mailing list