# vtkWindowToImageFilter - how to get voxel coordinate from pixel coordinate?

**URL:** https://discourse.vtk.org/t/vtkwindowtoimagefilter-how-to-get-voxel-coordinate-from-pixel-coordinate/3679
**Category:** Development
**Created:** [July 1, 2020, 8:01am UTC](https://discourse.vtk.org/t/vtkwindowtoimagefilter-how-to-get-voxel-coordinate-from-pixel-coordinate/3679 "2020-07-01T08:01:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![veltia](https://discourse.vtk.org/user_avatar/discourse.vtk.org/veltia/32/7191_2.png) [@veltia](https://discourse.vtk.org/u/veltia)
#### Post date: [July 1, 2020, 8:01am UTC](https://discourse.vtk.org/t/vtkwindowtoimagefilter-how-to-get-voxel-coordinate-from-pixel-coordinate/3679/1 "2020-07-01T08:01:44Z")

</div>

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,

---

<div class="post-metadata">

### Author: ![veltia](https://discourse.vtk.org/user_avatar/discourse.vtk.org/veltia/32/7191_2.png) [@veltia](https://discourse.vtk.org/u/veltia)
#### Post date: [July 2, 2020, 2:10am UTC](https://discourse.vtk.org/t/vtkwindowtoimagefilter-how-to-get-voxel-coordinate-from-pixel-coordinate/3679/2 "2020-07-02T02:10:24Z")

</div>

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 😄
