1vpClassifyScalars(3) Library Functions Manual vpClassifyScalars(3)
2
3
4
6 vpClassifyScalars - create a preclassified volume from scalar data
7
9 #include <volpack.h>
10
11 vpResult
12 vpClassifyScalars(vpc, scalar_data, length, scalar_field, gradi‐
13 ent_field, norm_field)
14 vpContext *vpc;
15 unsigned char *scalars;
16 int size;
17 int scalar_field, gradient_field, norm_field;
18
20 vpc VolPack context from vpCreateContext.
21
22 scalar_data
23 A 3D array containing one 8-bit scalar value for each voxel in
24 the volume.
25
26 length Size of scalar_data in bytes.
27
28 scalar_field
29 Field number identifying a voxel field for storing the scalar
30 value.
31
32 gradient_field
33 Field number identifying a voxel field for storing the gradient
34 magnitude of the scalar value.
35
36 norm_field
37 Field number identifying a voxel field for storing the surface
38 normal vector for the voxel.
39
41 vpClassifyScalars combines the functionality of vpVolumeNormals and
42 vpClassifyVolume to produce a preclassified volume directly from a 3D
43 array of scalar values without creating a 3D voxel array. This routine
44 is useful for preparing large data sets for rendering with a fixed
45 classification function, especially if the 3D voxel array would be too
46 large to fit in main memory. The primary limitation is that the only
47 fields each voxel may contain are the fields produced by vpVolumeNor‐
48 mals: an 8-bit scalar value, and 8-bit gradient and/or a 16-bit surface
49 normal vector. See also vpClassifyScanline for processing one scanline
50 of a scalar array at a time.
51
52 To use the function, first define the volume size, voxel size, and
53 voxel fields as you would before calling vpVolumeNormals. However,
54 there is no need to call vpSetRawVoxels. Also define the opacity
55 transfer function (see vpSetClassifierTable(3)). Then call vpClassi‐
56 fyScalars with the same arguments you would use for vpVolumeNormals;
57 see vpVolumeNormals(3) for more details. The result is a preclassified
58 volume, as described in vpClassifyVolume(3). If a voxel array has been
59 declared it is not used or modified.
60
61 Any existing preclassified volume data is destroyed.
62
64 Information about the current preclassified volume can be retrieved
65 with the following state variable codes (see vpGeti(3)):
66 VP_VIEW_X_SIZE, VP_VIEW_Y_SIZE, VP_VIEW_Z_SIZE, VP_VIEW_X_AXIS,
67 VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS.
68
70 The normal return value is VP_OK. The following error return values
71 are possible:
72
73 VPERROR_BAD_VOXEL
74 The voxel size or the voxel fields have not been specified or
75 have been incorrectly specified.
76
77 VPERROR_BAD_CLASSIFIER
78 The opacity transfer function tables have invalid sizes or are
79 associated with invalid voxel fields or have been incorrectly
80 specified.
81
83 VolPack(3), vpCreateContext(3), vpVolumeNormals(3), vpSetClassi‐
84 fierTable(3), vpClassifyVolume(3), vpClassifyScanline(3)
85
86
87
88VolPack vpClassifyScalars(3)