[vtkusers] vtkImagePlaneWidget: interpolated cursor position

David Gobbi dgobbi at imaging.robarts.ca
Thu Jan 8 19:50:42 EST 2004


Hi John,

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

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

Best of luck!

 - David


On Thu, 8 Jan 2004, John Hunter wrote:

> >>>>> "David" == David Gobbi <dgobbi at imaging.robarts.ca> writes:
>
>     David> Hi John, There is a way to do this indirectly by using
>     David> vtkImageReslice to interpolate a single voxel from the data
>     David> set:
>
> Hi David -- thanks for the response.  Sorry to be dense here, but it's
> not clear to me what x, y, z are in your example
>
>     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()
>
> I have ready access to the x, y display coords of the pointer in the
> viewport, and the x,y,z coords of the vtkImagePlaneWidget cursor.  But
> the latter are voxelated.  What in your example above provides the
> information to interpolate within the voxel?
>
> Could you elucidate?
>
> Thanks,
> John Hunter
>




More information about the vtkusers mailing list