Improvement to vtkDepthImageToPointCloud

Hi guys

I have made a new class vtkRendererToRectilinearGrid. It can be used for generating a grid output, where the depth coordinate is an attribute ZValues. The output can be passed to a vtkWarpScalar to generate a structured grid. It can be used for generating synthetic data for an in-scene camera - very useful for simulating images for 3D reconstruction.

During my investigation, I found that it could be of interest to expose also a property "CenterPointsAtPixels’ for the filter vtkDepthImageToPointCloud and also allow to output in either View, Pose or WorldCoordinates (this can be done quite elegantly using different matrices for the mapping). Would it be of interest if I add this to the existing vtkDepthImageToPointCloud?

I made my new class since I still cannot make a setup where vtkDepthImageToPointCloud correctly updates. I should look into this, since by adding the extra functionality, it will satisfy my needs.

Also, I would really appreciate if someone have an explanation for why hiding cells in structured data is not respected by the rendering anymore. As you can see on the image, I would like to flag cells and points (HIDDEN) when depth is ‘culled’.

image

I have added a PR for the new features https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10220

https://discourse.vtk.org/t/hidden-structured-data-shown-anyway-bug/11482