Written and maintained by CASRAI Editorial Board
Last updated
Scope: this page covers z-stacks in light microscopy and image analysis. It does not cover the dietary supplement sold under the name Z-Stack, and it contains no health or purchasing content.
Short answer
A z-stack is a series of images of the same field taken at successive focal depths along the optical (z) axis, so a thick specimen is recorded as a 3D volume. Set the step between slices to about 2.3 times smaller than the objective’s z-resolution; to “flatten” a stack in ImageJ, use Image > Stacks > Z Project.
Definition and scope
Each slice in a z-stack is an ordinary 2D image; the stack is the ordered set of slices. Stacks are most often collected on confocal microscopes, where each slice is an optical section, but widefield systems can also record focal series. The same idea underlies whole-slide imaging in digital pathology, and 3D reconstruction in super-resolution microscopy.
How a z-stack is acquired
The operator sets a top and bottom position (or a centre and range) and a step size, and the instrument records one image per position. Three values interact: the number of slices, the step size, and the total depth. Halving the step size doubles the slice count over the same depth, which lengthens acquisition and increases light exposure, so the trade-off matters for living or bleaching-prone samples (see photobleaching and phototoxicity in live-cell imaging).
Choosing the step size
The University of Queensland Institute for Molecular Bioscience advises setting the z-step to 2.3 times smaller than the z-resolution of the objective. Axial resolution depends on the objective’s numerical aperture, the wavelength of light and the refractive index of the sample, so the right step differs between objectives and dyes. The same source notes that vendors often default to 2x oversampling, whereas image deconvolution requires 2.3x to 3x, so a step somewhat smaller than the vendor default is advised when stacks will be deconvolved.
| Oversampling relative to z-resolution | Source statement |
|---|---|
| 2x | Typical vendor default (UQ IMB) |
| 2.3x | Recommended step size setting (UQ IMB) |
| 2.3x to 3x | Required for image deconvolution (UQ IMB) |
How to flatten a z-stack in ImageJ
ImageJ’s documentation uses “flatten” informally for collapsing a 3D stack to a single 2D image. The tool is Image > Stacks > Z Project…, which asks for a start and stop slice (defaulting to the first and last) and a projection type:
| Projection type | Listed in ImageJ Z-functions |
|---|---|
| Average intensity | Yes |
| Maximum intensity | Yes |
| Minimum intensity | Yes |
| Sum slices | Yes |
| Standard deviation | Yes |
| Median | Yes; gives the clearest rendering but filters out more of the image |
To project in blocks rather than the whole stack, use Image > Stacks > Tools > Grouped Z Project… (maximum, average or sum). The group size must be a factor of the total number of slices, and the output is a new stack.
Common misunderstandings
- A projection is not a measurement substrate. Projecting discards axial information, so quantification should be done on the stack, with projections used for display.
- More slices is not automatically better. Slices below the sampling the optics can resolve add exposure without adding information; the step guidance above is the reference point.
FAQ
What is the z stack?
In imaging, it is the set of images captured at different focal depths of one specimen, forming a 3D volume. A search for the bare phrase “Z Stack” can also return a dietary supplement; this page concerns microscopy only.
What is z-stacking in imaging?
Z-stacking is recording that series of focal planes and, optionally, combining them into one 2D image (a projection) or a 3D reconstruction.
How to flatten a z stack in ImageJ?
Open the stack, choose Image > Stacks > Z Project…, set the start and stop slices and pick a projection type such as maximum intensity. The result is a single 2D image.
Where can I buy Z Stack?
This page covers imaging z-stacks only and gives no supplement, purchasing or health information.
Sources
- University of Queensland, Institute for Molecular Bioscience, Nyquist conditions, read 2026-11-07.
- ImageJ Wiki, Z-functions, read 2026-11-07.







