# Depth map of 3D environment

**URL:** <https://discourse.slicer.org/t/depth-map-of-3d-environment/17238>\
**Category:** Support\
**Created:** [April 21, 2021, 7:33pm UTC](https://discourse.slicer.org/t/depth-map-of-3d-environment/17238 "2021-04-21T19:33:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ifried01](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@ifried01](https://discourse.slicer.org/u/ifried01)\
**Post date:** [April 21, 2021, 7:33pm UTC](https://discourse.slicer.org/t/depth-map-of-3d-environment/17238/1 "2021-04-21T19:33:36Z")

</div>

Hi All,

Is it possible to generate a depth map of the 3D environment in Slicer? I have looked around a bit and don’t believe this exists.

Thanks!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [April 21, 2021, 8:11pm UTC](https://discourse.slicer.org/t/depth-map-of-3d-environment/17238/2 "2021-04-21T20:11:04Z")

</div>

Do you mean of the rendered scene? You can get it with a bit of programming (get the vtk render window and read out the depth image). Something like [this](https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer).

---

<div class="post-metadata">

**Author:** ![ifried01](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@ifried01](https://discourse.slicer.org/u/ifried01)\
**Post date:** [April 21, 2021, 8:56pm UTC](https://discourse.slicer.org/t/depth-map-of-3d-environment/17238/3 "2021-04-21T20:56:09Z")

</div>

Yes, something like a segmentation.

Great, thank you! I’ll take a look and reach back out if I have any questions
