[vtkusers] vtkPicker returned actor
David Gobbi
david.gobbi at gmail.com
Tue Feb 23 19:55:32 EST 2016
If you want to interrogate your data, then the vtkCellPicker is the way to
go.
It provides tons of information about the pick point, such as:
The (x,y,z) pick coordinate in world coords and in data coords (use the
method
GetMapperPosition() to get the point in data coords).
The PointId, CellId, and SubId, and PCoords for any data set that was
picked.
For images, it provides the CellIJK indices and the PointIJK indices (you
want
the latter if you want to know what voxel was picked). This works
regardless
of whether you render the image as slices, or as a volume rendering, or if
the
image is a texture on a vtkPolyData.
It even has a method called GetDataSet() so that you can directly get the
image data that was picked (you'll have to use vtkImageData::SafeDownCast()
to verify that the data is actually image data).
- David
On Tue, Feb 23, 2016 at 5:37 PM, Lonni Besançon <lonni.besancon at gmail.com>
wrote:
> While reading your answer I was about to ask about speed and performance of
> both but you actually gave me the answer in the end :).
>
> One more quick question about the pickers then. So my vtkPlane is actually
> a
> slice of a bigger dataset (imageReslice). My question is, with the help of
> the pickers, is it possible to go from my screen coordinates to my dataset
> coordinates? For instance if I wanted to get on which point X,Y,Z my finger
> is placed when I'm touching the slice?
>
> Thanks again for the additional information and the initial help you have
> provided.
>
> Lonni
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160223/2066c4e4/attachment.html>
More information about the vtkusers
mailing list