How to generate and visualize the OCTree output for 3D point clouds or volumetric data

how to generate and visualize the OCTree output for 3D point clouds or volumetric data as the figure below? Thanks!