1vpClassifyVolume(3) Library Functions Manual vpClassifyVolume(3)
2
3
4
6 vpClassifyVolume, vpDestroyClassifiedVolume - create/destroy a preclas‐
7 sified volume for fast rendering
8
10 #include <volpack.h>
11
12 vpResult
13 vpClassifyVolume(vpc)
14 vpContext *vpc;
15
16 vpResult
17 vpDestroyClassifyVolume(vpc)
18 vpContext *vpc;
19
21 vpc VolPack context from vpCreateContext.
22
24 vpClassifyVolume is used to compute a preclassified volume for the fast
25 rendering algorithm. The preclassified volume is an internal data
26 structure optimized for rendering speed. vpClassifyVolume should be
27 called after a voxel array has been defined (with vpSetVolumeSize,
28 vpSetVoxelSize, vpSetVoxelField, and vpSetRawVoxels) and initialized
29 (with vpVolumeNormals or a user-defined routine). An opacity transfer
30 function must also be defined with vpSetClassifierTable, and the mini‐
31 mum opacity threshold should be set with the VP_MIN_VOXEL_OPACITY
32 parameter to vpSeti. Two alternative routines are provided to compute
33 a preclassified volume directly from a 3D scalar array or a sequence of
34 scalar scanlines in order to avoid allocating a large 3D voxel array
35 (see vpClassifyScalars(3) and vpClassifyScanline(3)).
36
37 vpClassifyVolume classifies and processes the data in the voxel array
38 and creates a separate preclassified volume. The preclassified data is
39 stored in a run-length encoded format, and voxels that have opacities
40 less than or equal to the minimum opacity threshold are discarded.
41 Normally, three copies of the preclassified volume are created, one for
42 each of the three principal viewing axis. If only one or two copies
43 are necessary for the required range of viewpoints then vpSeti may be
44 called with one or more of the following parameters to specify which
45 copies are required: VP_VIEW_X_AXIS, VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS.
46 Using these parameters is not recommended unless swap space is lacking.
47
48 If a min-max octree is present in the rendering context (see vpCreateM‐
49 inMaxOctree(3)) then it is used to accelerate computation of the pre‐
50 classified volume. It is advantageous to create a min-max octree if
51 the same volume data will be classified multiple times (with different
52 opacity transfer functions).
53
54 Once vpClassifyVolume is finished, the original voxel array is no
55 longer necessary for rendering as long as the opacity transfer function
56 and the volume data do not change. If any changes are made, then the
57 preclassified volume must be explicitly recomputed by calling vpClassi‐
58 fyVolume again. Only one preclassified volume may be stored in a ren‐
59 dering context at a time. Calling vpClassifyVolume causes any existing
60 preclassified volume to be destroyed.
61
62 vpDestroyClassifiedVolume destroys the current preclassified volume and
63 frees the associated space.
64
66 Information about the current preclassified volume can be retrieved
67 with the following state variable codes (see vpGeti(3)):
68 VP_VIEW_X_SIZE, VP_VIEW_Y_SIZE, VP_VIEW_Z_SIZE, VP_VIEW_X_AXIS,
69 VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS.
70
72 The normal return value is VP_OK. The following error return values
73 are possible:
74
75 VPERROR_BAD_VOXEL
76 The voxel size or the voxel fields have not been specified or
77 have been incorrectly specified.
78
79 VPERROR_BAD_VOLUME
80 The volume array or volume dimensions have not been specified,
81 or the size of the volume array does not match the volume dimen‐
82 sions.
83
84 VPERROR_BAD_CLASSIFIER
85 The opacity transfer function tables have invalid sizes or are
86 associated with invalid voxel fields or have been incorrectly
87 specified.
88
90 VolPack(3), vpCreateContext(3), vpSetClassifierTable(3), vpClassi‐
91 fyScalars(3), vpClassifyScanline(3)
92
93
94
95VolPack vpClassifyVolume(3)