How to write code for the 3D imager?