One of the main advantages of confocal microscopy is the ability to take optical slices of a sample and using these to produce a 3D structure of the specimen. This allows us to understand and analyze the entire structure without physically dissecting the sample.

These 3D renderings are produced through a process known as optical sectioning. Here, the sample is scanned in the x-y plane at a known depth to produce an optical slice. This process is continued whilst changing the z-axial focus each time i.e. changing the depth at which the microscope is scanning by moving the sample stage. This results in a collection of horizontal sample slices, also called a Z-stack. This set of images is used to calculate and create the 3D structure of the sample.