[vtkusers] draw crosshair in image viewer

gregthom992 gregthom992 at gmail.com
Sat Jun 20 02:27:08 EDT 2015


Hello there

Hi, in my application which displays images in 2D view using
vtkImageViewer2, I want to display a cross-hair at the center of the image.
what is a good way to do this ? 
I have used vtkHandleWidget and vtkPointHandleRepresentation2D but I haven't
got too far yet. Using, vtkHandleWidget and vtkPointHandleRepresentation2D I
can display this small cross hair in the center of the image using code
snippet below:

        self.__HandleWidget = vtk.vtkHandleWidget()
        self.__PointHandleRepresentation2D =
vtk.vtkPointHandleRepresentation2D()
       
self.__HandleWidget.SetRepresentation(self.__PointHandleRepresentation2D)

        self.__HandleWidget.SetInteractor(self.GetInteractor())
        self.__HandleWidget.On()

      
Viewer.getPointHandleRepresentation2D().SetWorldPosition(Viewer.GetImageActor().GetCenter())



How can I make the cross hairs lines to fit withing the bounds of my
displayed image?

Secondly, what is I wanted the two lines of the crosshair to be draggable
separately? what would I need to do in this case ? 

Thank you

GT

<http://vtk.1045678.n5.nabble.com/file/n5732462/crosshairs.png> 



--
View this message in context: http://vtk.1045678.n5.nabble.com/draw-crosshair-in-image-viewer-tp5732462.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list