Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.


source files: xvol.[ch]


    :VOXELS <grl:voxels>
    :RENDERING-RELATION <grl:rendering-relation>
  [ :SLICE <fix:slice>     ]
  [ :AXIS <fix:axis>       ]
  [ :ZOOM-BY <fix:zoom>    ]
  [ :RESULT-IN <grl:image> ]


This function is intended to generate high-quality volume renderings, spending as much CPU time as needed. The long-term design goal is to produces color images based on the GL rendering equation, in which each voxel value may have any material values, and surface normals are given by voxel gradient. At present, only a simple subset of the full rendering equation is implemented, based on diffuse color, gradient 'surface normals' and a fixed light source.

'voxels' should be either a rank-three CLASS-16-BIT-FLOAT-ARRAY or else a graphic relation holding such an array, named :INTENSITY.

'slice' indicates the first visible plane along the axis: planes numbered less than this are completely ignored during rendering.

'Axis' indicates which view the slice should be taken. It should be 0, 1 or 2, and defaults to 0.

'zoom' indicates how much the image should be enlarged by during the copy, and defaults to 1. Currently, the only other supported values are 2, 4, 8 and 16.

'rendering-relation' must be a rank-1 relation: it is indexed by voxel values (hence should normally be 4096 long) and specifies the color and transparency to be assigned to each possible voxel value. A suitable relation may be conveniently constructed via XVOL-BUILD-RENDERING-RELATION, but you are free to do so any other way. The arrays required by XVOL-RENDER-IN-COLOR are all CLASS-FLOAT-ARRAY instances: :DIFFUSE-RED, :DIFFUSE-GREEN, and :DIFFUSE-BLUE, specify the color of the voxel. (Future versions of this function may support the other components of the GL rendering equation: EMISSION-*, AMBIENT-* and SPECULAR-*.) :ALPHA specifies the translucency of the pixel, from 0.0 for transparent to 1.0 for opaque.

If a :RESULT-IN value is supplied, and is of appropriate type, the result will be placed in it and 'image' returned; otherwise, a fresh image relation will be allocated and returned.

Go to the first, previous, next, last section, table of contents.