Z-buffer scale

Hello.
I’m creating a depth map from 3D just like in example:
https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer
Is there an easy way to set the output so that the closest point of actor is Whitest (255,255,255) and the furthest point is Blackest (0,0,0)
I know that it can be adjusted through vtkImageShiftScale(), but I can’t make it work the way I want.

Hi,
you can also use
float* renZBuffer = renWin->GetZbufferData(0, 0, renderWindowSizeX - 1, renderWindowSizeY - 1);