[vtkusers] vtkImagePlaneWidget: interpolated cursor position

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Jan 14 09:25:25 EST 2004


>>>>> "David" == David Gobbi <dgobbi at imaging.robarts.ca> writes:

    David> Hi John, The (x,y,z) are the world coordinates of the point
    David> at which you want to interpolate the voxel value.  If
    David> vtkImagePlaneWidget gave you access to its Picker then you
    David> could get (x,y,z) by doing picker->GetPickPosition().

    David> Unfortunately it doesn't, so you would have do the picking
    David> yourself.  Hmm, that makes it a bit complicated.

    David> Best of luck!

Thanks David for your suggestions.   This turned out to not be too
difficult with

    x, y = interactor.GetEventPosition()
    xyz = [x, y, 0.0]
    picker = vtk.vtkWorldPointPicker()
    picker.Pick(xyz, renderer)
    pos = picker.GetPickPosition()
    return pos

John Hunter



More information about the vtkusers mailing list