VOLUME Function
Defines the volumetric data that can be used by the RENDER function.
Usage
result = VOLUME(voxels)
Input Parameters
voxels—A 3D byte array containing voxel data.
Returned Value
resultA structure that defines a volumetric object.
Keywords
ColorA 256-element double-precision floating-point vector containing the color (intensity) coefficients of the object. (Default: Color(*)=1.0) For more information, see the PV‑WAVE User’s Guide.
KambA 256-element double-precision floating-point vector containing the ambient (flat shaded) coefficients. (Default: Kamb=FINDGEN(256)/255) For more information, see the PV‑WAVE User’s Guide.
KdiffA 256-element double-precision floating-point vector containing the diffuse reflectance coefficients. (Default: Kdiff(*)=0.0) For more information, see the PV‑WAVE User’s Guide.
KtranA 256-element double-precision floating-point vector containing the specular transmission coefficients. (Default: Ktran(*)=0.0) For more information, see the PV‑WAVE User’s Guide.
TransformA 4-by-4 double-precision floating-point array containing the local transformation matrix whose default is the identity matrix. For more information, see the s PV‑WAVE User’s Guide.
Discussion
A VOLUME is used by the RENDER function to render volumetric data. You must specify a 3D array of bytes that represent this data in the call to VOLUME. Each byte in the voxel array corresponds to an index into the material properties associated with the volume.
For example, the material properties used for shading the point (x,y,z) in some data are Color(voxels(x,y,z)), Kamb(voxels(x,y,z)), etc. The surface normal at (x,y,z) is calculated using a 3D Sobel gradient operator on the actual voxel values. The default orientation of a volume is an origin-centered unit cube.
If the voxels are not cubic, you may adjust the scaling of the dimensions with the Transform keyword by using a matrix generated by the T3D procedure with the Scale keyword.
Volumetric data is applicable to any voxel processing domain, such as for the visualization of astronomical, geological, and medical data.
Example
voxels = BYTARR(16, 16, 16)
voxels(*) = 255
diffuse = FLTARR(256)
T3D, /Reset, Rotate=[15, 30, 45]
cube = VOLUME(voxels, Transform=!P.T, Kdiff=diffuse, $
   Kamb=FLTARR(256))
TV, RENDER(cube)
See Also