Quantcast

Picking in vtkImagePlaneWidget and getting IJK volume point

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Picking in vtkImagePlaneWidget and getting IJK volume point

fblupi
I'm trying to get the IJK coordinates of a voxel from a volume that I pick from the slice obtained with a vtkImagePlaneWidget (using GetResliceOutput method).

I know I can get the coordinates of that slice using a cell Picker:


vtkSmartPointer<vtkCellPicker> picker = vtkSmartPointer<vtkCellPicker>::New();
picker->SetTolerance(0.0005);

int* pos = this->GetInteractor()->GetEventPosition();
picker->Pick(pos[0], pos[1], pos[2], this->GetDefaultRenderer());

int* ijk = picker->GetPointIJK();


But the IJK point obtained is in the slice coordinates so K is always 0.

I would like to get the IJK coordinates of the point picked in the volume coordinates as I could make using the vtkVolumePicker in a 3D viewer.

Thanks in advance.
Loading...