Documentation for vtkNormalEncoder

vtkNormalEncoder - encode volume gradients and gradient magnitudes, build shading table

Super Class: vtkObject

Description:

vtkNormalEncode takes vtkStructuredPoints as input and can generate two 3D array data sets - a two-byte per value array which encodes normal direction, and a 1 byte per value array which captures gradient magnitude information. Once these structures have been build, a shading table can be created for a given directional light source and given material properties.

 

Methods:

void vtkNormalEncoder ()
void vtkNormalEncoder ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
static vtkNormalEncoder *New ()
void SetScalarInput (vtkStructuredPoints *)
vtkStructuredPoints *GetScalarInput ()
void SetSampleSpacingInVoxels (int )
int GetSampleSpacingInVoxels ()
void SetGradientMagnitudeScale (float )
float GetGradientMagnitudeScale ()
void SetGradientMagnitudeBias (float )
float GetGradientMagnitudeBias ()
void UpdateNormals ()
void BuildShadingTable (float ,float ,float ,float ,float ,int )
float *GetRedDiffuseShadingTable ()
float *GetGreenDiffuseShadingTable ()
float *GetBlueDiffuseShadingTable ()
float *GetRedSpecularShadingTable ()
float *GetGreenSpecularShadingTable ()
float *GetBlueSpecularShadingTable ()
unsigned short *GetEncodedNormals ()
int GetEncodedNormalIndex (int )
int GetEncodedNormalIndex (int ,int ,int )
unsigned char *GetGradientMagnitudes ()
void SetNumberOfThreads (int )
int GetNumberOfThreads ()
void InitializeIndexTable ()
unknown SwitchOnDataType (void *)

 

Detailed Method Descriptions:

Construct a vtkNormalEncoder with initial values of NULL for the ScalarInput, EncodedNormal, and GradientMagnitude. Also, indicate that the IndexTable has not yet been initialized. The GradientMagnitudeRange and the GradientMangitudeTable are initialized to default values - these will change in the future when magnitude of gradient opacities are included

static vtkNormalEncoder *New ()

Set/Get the scalar input for which the normals will be calculated

void SetScalarInput (vtkStructuredPoints *)
vtkStructuredPoints *GetScalarInput ()

Set/Get the spacing between samples for the finite differences method used to compute the normal. This spacing is in voxel units.

void SetSampleSpacingInVoxels (int )
int GetSampleSpacingInVoxels ()

Set/Get the scale and bias for the gradient magnitude

void SetGradientMagnitudeScale (float )
float GetGradientMagnitudeScale ()
void SetGradientMagnitudeBias (float )
float GetGradientMagnitudeBias ()

Recompute the encoded normals and gradient magnitudes.

void UpdateNormals ()

Build a shading table for a light with the specified direction, and color for an object of the specified material properties. material[0] = ambient, material[1] = diffuse, material[2] = specular and material[3] = specular exponent. If the update flag is 0, the shading table is overwritten with these new shading values. If the update_flag is 1, then the computed light contribution is added to the current shading table values.

void BuildShadingTable (float ,float ,float ,float ,float ,int )

Get the red/green/blue shading table.

float *GetRedDiffuseShadingTable ()
float *GetGreenDiffuseShadingTable ()
float *GetBlueDiffuseShadingTable ()
float *GetRedSpecularShadingTable ()
float *GetGreenSpecularShadingTable ()
float *GetBlueSpecularShadingTable ()

Get the encoded normals.

unsigned short *GetEncodedNormals ()

Get the encoded normal at an x,y,z location in the volume

int GetEncodedNormalIndex (int )
int GetEncodedNormalIndex (int ,int ,int )

Get the gradient magnitudes

unsigned char *GetGradientMagnitudes ()

Get/Set the number of threads to create when encoding normals

void SetNumberOfThreads (int )
int GetNumberOfThreads ()