A voxel is a discrete element of a three-dimensional grid, analogous to a pixel in a two-dimensional image. Its name combines “volume” and “pixel.” Voxels represent information distributed through space, such as material occupancy, density, temperature, color, or a measured imaging signal. They are widely used in computer graphics, medical imaging, scientific visualization, simulation, and three-dimensional scene analysis. Although often depicted as small cubes, voxels are not necessarily cubic, and a voxel’s stored value need not describe a visible solid block.
Spatial representation
A regular voxel grid divides a three-dimensional region into cells indexed by integer coordinates, typically . Unlike a polygon vertex, whose coordinates are usually stored explicitly, a voxel’s position can be inferred from its index and the grid’s spatial metadata.
For an axis-aligned grid, the center of a voxel can be written as
where is the outer corner of the grid and are the cell dimensions. Other conventions place the origin at the center of the first voxel. More generally, an affine transformation maps voxel indices into physical coordinates, allowing grids to have arbitrary orientation.
When the three cell dimensions are equal, voxels are isotropic and their cells are cubes. When they differ, voxels are anisotropic, commonly taking the form of rectangular boxes. Physical dimensions matter: counting a displacement of one voxel along different axes does not necessarily imply equal physical distances.
The word voxel is used in two closely related senses:
- Volume cell: a finite region of space associated with a stored value, such as occupied or empty.
- Volume sample: a value sampled at a position in a three-dimensional field, from which values between samples may be reconstructed.
This distinction affects interpretation. An imaging value may reflect a spatially weighted measurement rather than a uniform property of a sharply bounded box. Rendering such data as cubes is a display choice, not an inherent property of the data.
Values and data organization
A voxel may contain a single scalar, several channels, or a more complex record. Common examples include:
- A binary occupancy flag.
- A material or object identifier.
- A scalar quantity such as density or temperature.
- Color and opacity.
- A velocity vector.
- A distance to the nearest surface.
- Class probabilities or learned feature vectors.
A sequence of voxel volumes can represent change over time. Time and additional measurement channels add dimensions to the dataset, but the three spatial dimensions still define the voxels.
Dense grids
A dense volume stores every grid location, commonly using a multidimensional array. This provides direct indexing and supports regular neighborhood operations, but storage increases with the product of the grid dimensions:
where is the number of bytes stored per voxel, excluding metadata and other overhead.
For example, a volume with one 16-bit value per voxel requires 256 MiB. Doubling resolution along all three axes multiplies the voxel count by eight. This cubic growth is a central limitation of dense voxel representations.
Sparse and hierarchical grids
When much of a volume is empty or uniform, sparse data structures can avoid allocating every cell. Common approaches include:
- Sparse blocks or bricks, which allocate small dense regions only where needed.
- Hash tables that associate spatial indices with allocated cells or blocks.
- Octrees, which recursively divide regions into eight children.
- Compressed representations that encode repeated values or repeated spatial patterns.
Sparse storage can greatly reduce memory consumption, but introduces indexing overhead and less regular memory access. Its benefits depend on the spatial distribution of the data and the operations being performed.
Creating and processing voxel data
Voxel data may originate from measurement, numerical simulation, procedural generation, or conversion from another geometric representation.
Voxelization converts geometry into a voxel grid. Surface voxelization marks cells intersecting a surface; solid voxelization also identifies interior cells. The latter requires a suitable rule for distinguishing inside from outside, particularly when the source geometry contains gaps or intersecting surfaces. Voxelization generally loses detail below the grid resolution.
Voxel processing often extends techniques from image processing into three dimensions. Examples include filtering, thresholding, connected-component analysis, and segmentation. Neighborhoods are commonly defined by face, edge, and corner adjacency: an interior cell in a cubic grid has 6 face neighbors, 18 face-or-edge neighbors, and 26 neighbors when corners are included. The connectivity convention can affect whether structures are treated as connected.
Resampling changes a volume’s grid spacing, orientation, or dimensions. Nearest-neighbor interpolation selects an existing sample and is commonly used for categorical labels. Trilinear interpolation combines eight surrounding samples to estimate a value between grid points. Higher-order methods can produce smoother reconstructions but may introduce overshoot or other artifacts.
Interpolation does not recover information absent from the original measurements. In particular, converting anisotropic data to an isotropic grid does not make its underlying spatial resolution equal in every direction.
Rendering and surface extraction
Voxel data can be displayed without drawing individual cubes.
Direct volume rendering
Volume rendering constructs an image directly from a three-dimensional field. A common method casts viewing rays through the volume, samples values along each ray, maps them to color and opacity, and composites their contributions.
The mapping from data values to visual properties is called a transfer function. It can emphasize selected materials or value ranges while making others transparent. The appearance of a volume therefore depends not only on the stored data but also on the transfer function, sampling interval, and lighting model.
Volume rendering is related to ray tracing, but often accumulates contributions along a ray rather than finding only the nearest opaque surface.
Surface extraction
An alternative is to extract an explicit surface and render it as a polygon mesh. An isosurface consists of locations where a scalar field equals a chosen threshold. The marching cubes algorithm, published in 1987, constructs an approximate isosurface by examining local configurations of grid samples.
Surface extraction can exploit conventional mesh-rendering pipelines, but the selected threshold affects the resulting shape. It also discards volumetric information unless that information is retained separately.
Block rendering
In voxel art and some games, occupied cells are intentionally displayed as blocks. Renderers may generate polygons only for exposed faces and merge adjacent faces to reduce geometric complexity. A block-like appearance is therefore one use of voxel data, not a requirement of voxel representation.
Applications
Imaging and scientific visualization
In computed tomography and magnetic resonance imaging, reconstructed images are commonly organized as voxel volumes. A voxel stores an imaging quantity, not necessarily a direct identification of a particular tissue.
A voxel may include contributions from multiple materials or tissues, producing a partial-volume effect. Voxel spacing also differs from effective imaging resolution, which depends on acquisition, reconstruction, and other properties of the imaging system.
Scientific applications use voxel fields to visualize quantities distributed through three-dimensional space, including fluid properties, geological structures, and microscopy measurements.
Graphics, modeling, and fabrication
Voxel models support operations on solid interiors, including carving, filling, and combining volumes. These operations can be simpler on occupancy grids or distance fields than on explicit surface meshes.
They are used in terrain systems, destructible environments, procedural modeling, and additive-manufacturing workflows. Surface meshes remain more compact for many smooth objects, while voxel representations can be convenient when internal material structure or repeated changes to topology are important.
Robotics and machine learning
In computer vision and robotics, voxel grids provide a spatial representation into which depth measurements or point clouds can be accumulated. Occupancy grids represent whether space is occupied, empty, or unknown. Unknown space is distinct from observed free space.
A signed distance function instead stores distance to a surface, with the sign distinguishing its two sides. Truncated signed distance fields retain distances only within a limited band and are widely used in depth-based reconstruction.
Three-dimensional convolutional neural networks can process voxel grids for recognition, segmentation, and reconstruction. Dense three-dimensional computation is costly, so sparse operations, hierarchical grids, and alternative point- or surface-based representations are also used.
Resolution, accuracy, and limitations
Voxel representations make spatial neighborhoods explicit and naturally describe object interiors, but their accuracy and efficiency depend strongly on resolution.
Discretization error arises when continuous geometry is represented on a finite grid. Thin structures may disappear, separate objects may merge, and oblique boundaries may appear stair-stepped. Sampling can also produce aliasing when spatial variation is too fine for the grid.
Increasing resolution reduces some errors but raises storage and processing costs. Sparse grids reduce the cost of empty regions, while adaptive grids concentrate detail where needed; neither removes the need to choose an appropriate spatial scale.
Voxel count alone is not a measure of information quality. A heavily interpolated volume can contain many cells without additional measured detail. Likewise, a voxel labeled “occupied” does not specify exactly where material lies within that cell unless further information is stored.
The choice between voxels, point clouds, meshes, and continuous field representations depends on the task. Voxels provide convenient indexing and volumetric operations; meshes describe surfaces efficiently; point clouds preserve sampled positions without imposing a complete grid; and continuous representations evaluate spatial properties at queried coordinates. Hybrid systems combine these approaches when no single representation meets all requirements.