---
name: "VolumeSize"
section: "3"
platform: "linux"
package: "libvolpack1-dev"
version: "1.0b3-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/VolumeSize"
---

# VolumeSize(3)

define the dimensions of a volume

## NAME

vpSetVolumeSize - define the dimensions of a volume

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpSetVolumeSize(***vpc, xlen, ylen, zlen***)**

-

  vpContext \**vpc;*

-

  int *xlen, ylen, zlen;*

## ARGUMENTS

- *vpc*

  VolPack context from **vpCreateContext.**

- *xlen*

  Size of first dimension of the volume in voxels.

- *ylen*

  Size of the second dimension of the volume in voxels.

- *zlen*

  Size of the third dimension of the volume in voxels.

## DESCRIPTION

**vpSetVolumeSize** is used to define the dimensions of a volume. It must be called before volume data is loaded into a rendering context.  Any existing precomputed volume data structures in the context are destroyed.

## STATE VARIABLES

The current volume dimensions may be retrieved with the following state variable codes (see vpGeti(3)): VP\_XLEN, VP\_YLEN, VP\_ZLEN.

## ERRORS

The return value is always VP\_OK.

## SEE ALSO

[VolPack(3)](/VolPack/3.md), vpCreateContext(3)
