vtkWindowToImageFilter - how to get voxel coordinate from pixel coordinate?

Hi all,

I’m using class vtkWindowToImageFilter to get the 2D screenshot from renderwindow.

Then I get some interested pixels from 2D image.

Any chance I can get the corresponding voxel coordinates back to vtk 3D renderwindow? it seems about vtkCamera settings.

flow: renderWindow -> png image { vtkWindowToImageFilter } -> interested pixels { do something } -> voxel coordinate { ? }

Regards,

Solved.

  1. png image ->
  2. interested pixels coordinate ->
  3. the ratio of the xy coordinate value from the image center to the pixel ‘image center = (0,0) in vtk view coordinate’ ->
  4. vtk view coordinate value ->
  5. vtk display coordinate value ->
  6. cell pick display coordinate ->
  7. world coordinate value :smile: