[vtkusers] position of a pixel

Jose Ernesto Pfuturi Huisa daviddarkzero at hotmail.com
Sat Sep 6 16:43:52 EDT 2008


Hi Gokhan, I don't know how to do exactly but this can help you.
class vtkRenderWindowInteractor() can get a point , first you need a event such as "LeftButtonPressEvent"
#An Example in Python
iren.AddObserver("LeftButtonPressEvent", pick)

and a function such as "pick"

x = iren.GetEventPosition()[0]
y = iren.GetEventPosition()[1]
 print "coordenadas",x,y
In this manner you  can get tha point where is your lesion.

Now, to get the pixel maybe you need to get an Actor( a imagen in this case), therefore:
picker = vtkCellPicker()
cellID=picker.Pick(x,y,0,ren) 
if cellID == 0: 
        return ;       
else:
        pickedActor = picker.GetActor()

bye,

José



Date: Sat, 6 Sep 2008 22:52:49 +0300
From: goksoy66 at gmail.com
To: vtkusers at vtk.org
Subject: [vtkusers] position of a pixel

hi all,

how can i get the position of a pixel by clicking on an image? 

i have a mammogram image and there is a "lesion" on this image. I have to specify the position of lesion by clicking on it. How can i do this? 


thanks,

Gokhan


_________________________________________________________________
¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón
http://entretenimiento.es.msn.com/corazon/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080906/dd67b0e4/attachment.htm>


More information about the vtkusers mailing list