[vtkusers] vtkImagePlaneWidget: interpolated cursor position

David Gobbi dgobbi at imaging.robarts.ca
Thu Jan 8 16:44:06 EST 2004


Hi John,

There is a way to do this indirectly by using vtkImageReslice to
interpolate a single voxel from the data set:

reslice = vtkImageReslice()
reslice.SetInput(data)
reslice.SetInterpolationModeToLinear()

reslice.SetOutputOrigin(x,y,z)
reslice.GetOutput().SetUpdateExtent(0,0,0,0,0,0)
reslice.GetOutput().Update()

value = reslice.GetOutput().GetScalarComponentAsFloat()

This doesn't really answer your question, though, because this
solution doesn't involve the vtkImagePlaneWidget at all.

 - David


On Thu, 8 Jan 2004, John Hunter wrote:

>
> I am using a vtkImagePlaneWidget and get the current cursor position
> and voxel with
>
>   pw.GetCursorData(xyzv)
>
> However, this returns the position in the (not interpolated) image
> data.  As you smoothly drag the mouse across the image plane the
> position makes discrete integer jumps from one voxel position to
> another.  Is there an easy way to get the interpolated position of the
> mouse pointer using the IPW functionality?
>
> Thanks!
> John Hunter
> VTK-4.3
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list