[vtkusers] vtkImagePlaneWidget: interpolated cursor position

David Gobbi dgobbi at imaging.robarts.ca
Fri Jan 9 01:21:04 EST 2004


Hi Dean,

Thanks for jumping into the discussion.  See comments below.


On Thu, 8 Jan 2004 dean.inglis at camris.ca wrote:

> John, David,
>
> 1) vtkIPW allows you to set the picker, so you could 'listen' in as
> an obsever through the callback mechanism, although I've never tried.

I missed that!  So it should be possible to just do
  picker = vtkCellPicker()
  planeWidget.SetPicker(picker)
and then each time you want to get the value at screen coords (X,Y):
  planeWidget.UpdateCursor(X,Y)
  x,y,z = picker.GetPickPosition()
and finally the vtkImageReslice code that I included in my previous email.

> 2) when I made the cursor feature, what I really wanted was what
> you are requesting John: interpolated voxel data and not
> nearest neighbour as it is now.  If David or anyone else would
> like to add that in .... :)

"Anyone else" can kindly take a look at the code in vtkProbeFilter.cxx as
the best example of interpolating a value from a vtkDataSet in C++ ;)

 - David




More information about the vtkusers mailing list