# Pipeline within a filter: vtkDepthImageToPointCloud

**URL:** https://discourse.vtk.org/t/pipeline-within-a-filter-vtkdepthimagetopointcloud/11269
**Category:** Support
**Tags:** code
**Created:** [April 20, 2023, 6:40pm UTC](https://discourse.vtk.org/t/pipeline-within-a-filter-vtkdepthimagetopointcloud/11269 "2023-04-20T18:40:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 20, 2023, 6:40pm UTC](https://discourse.vtk.org/t/pipeline-within-a-filter-vtkdepthimagetopointcloud/11269/1 "2023-04-20T18:40:33Z")

</div>

Hi Developers

I had some trouble getting `vtkDepthImageToPointCloud` to update when the camera is updated. I create instead a homemade `vtkSceneSource`, which contains a `vtkRenderWindow` and allow the user to set both a `vtkCamera` and a `vtkRenderer`. It works really well and I can use this for simulating what a camera sees in a scene for generating depth images for reconstruction.

I read an old post from David Gobbi (@dgobbi ) that it is very bad to have a pipeline residing inside a filter.

[https://public.kitware.com/pipermail/vtkusers/2009-December/055773.html](https://public.kitware.com/pipermail/vtkusers/2009-December/055773.html)

Is this still the case? Just let me know

If it is still the case, I will try to fix `vtkDepthImageToPointCloud` or the setup that I am using.

Another thing. I have made an `vtkImplicitRectangleWidget` and a widget inherit from this which allows me to move a camera around in the scene, where I can enable a view of frustum. Do you have any recommendations for doing something similar with what is already available in VTK.

Thanks in advance  
Jens Munk

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 20, 2023, 6:51pm UTC](https://discourse.vtk.org/t/pipeline-within-a-filter-vtkdepthimagetopointcloud/11269/2 "2023-04-20T18:51:53Z")

</div>

Just a note: my comments in that email were from the perspective of VTK 4. Modern VTK has separated the old `SetInput()` methods into `SetInputConnection()` vs. `SetInputData()`. This means that in modern VTK, it’s easy to control whether or not pipeline request go upstream. And likewise, this means that in modern VTK it’s not unusual to have a pipeline within a filter (though it has to be done correctly, of course!).

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 20, 2023, 7:05pm UTC](https://discourse.vtk.org/t/pipeline-within-a-filter-vtkdepthimagetopointcloud/11269/3 "2023-04-20T19:05:55Z")

</div>

I thought so too that it wasn’t relevant anymore. I will try to make use of `vtkDepthImageToPointCloud`. Thanks David
