FreeMat: vtkLookupTable

FreeMat

- Main Page
- Related Pages

vtkLookupTable

Section: Visualization Toolkit Common Classes

# Usage

vtkLookupTable is an object that is used by mapper objects to map scalar values into rgba (red-green-blue-alpha transparency) color specification, or rgba into scalar values. The color table can be created by direct insertion of color values, or by specifying hue, saturation, value, and alpha range and generating a table.

To create an instance of class vtkLookupTable, simply invoke its constructor as follows

      obj = vtkLookupTable

# Methods

The class vtkLookupTable has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkLookupTable class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkLookupTable = obj.NewInstance ()`
- `vtkLookupTable = obj.SafeDownCast (vtkObject o)`
- `int = obj.IsOpaque ()` - Return true if all of the values defining the mapping have an opacity equal to 1. Default implementation return true.
- `int = obj.Allocate (int sz, int ext)` - Allocate a color table of specified size.
- `obj.Build ()` - Generate lookup table from hue, saturation, value, alpha min/max values. Table is built from linear ramp of each value.
- `obj.ForceBuild ()` - Force the lookup table to regenerate from hue, saturation, value, and alpha min/max values. Table is built from a linear ramp of each value. ForceBuild() is useful if a lookup table has been defined manually (using SetTableValue) and then an application decides to rebuild the lookup table using the implicit process.
- `obj.SetRamp (int )` - Set the shape of the table ramp to either linear or S-curve. The default is S-curve, which tails off gradually at either end. The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, while the equation for the linear ramp is simply y = x. For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp. The equation for the SQRT is y = sqrt(x).
- `obj.SetRampToLinear ()` - Set the shape of the table ramp to either linear or S-curve. The default is S-curve, which tails off gradually at either end. The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, while the equation for the linear ramp is simply y = x. For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp. The equation for the SQRT is y = sqrt(x).
- `obj.SetRampToSCurve ()` - Set the shape of the table ramp to either linear or S-curve. The default is S-curve, which tails off gradually at either end. The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, while the equation for the linear ramp is simply y = x. For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp. The equation for the SQRT is y = sqrt(x).
- `obj.SetRampToSQRT ()` - Set the shape of the table ramp to either linear or S-curve. The default is S-curve, which tails off gradually at either end. The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, while the equation for the linear ramp is simply y = x. For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp. The equation for the SQRT is y = sqrt(x).
- `int = obj.GetRamp ()` - Set the shape of the table ramp to either linear or S-curve. The default is S-curve, which tails off gradually at either end. The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, while the equation for the linear ramp is simply y = x. For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp. The equation for the SQRT is y = sqrt(x).
- `obj.SetScale (int scale)` - Set the type of scale to use, linear or logarithmic. The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.
- `obj.SetScaleToLinear ()` - Set the type of scale to use, linear or logarithmic. The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.
- `obj.SetScaleToLog10 ()` - Set the type of scale to use, linear or logarithmic. The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.
- `int = obj.GetScale ()` - Set the type of scale to use, linear or logarithmic. The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.
- `obj.SetTableRange (double r[2])` - Set/Get the minimum/maximum scalar values for scalar mapping. Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.
- `obj.SetTableRange (double min, double max)` - Set/Get the minimum/maximum scalar values for scalar mapping. Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.
- `double = obj. GetTableRange ()` - Set/Get the minimum/maximum scalar values for scalar mapping. Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.
- `obj.SetHueRange (double , double )` - Set the range in hue (using automatic generation). Hue ranges between [0,1].
- `obj.SetHueRange (double a[2])` - Set the range in hue (using automatic generation). Hue ranges between [0,1].
- `double = obj. GetHueRange ()` - Set the range in hue (using automatic generation). Hue ranges between [0,1].
- `obj.SetSaturationRange (double , double )` - Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
- `obj.SetSaturationRange (double a[2])` - Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
- `double = obj. GetSaturationRange ()` - Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
- `obj.SetValueRange (double , double )` - Set the range in value (using automatic generation). Value ranges between [0,1].
- `obj.SetValueRange (double a[2])` - Set the range in value (using automatic generation). Value ranges between [0,1].
- `double = obj. GetValueRange ()` - Set the range in value (using automatic generation). Value ranges between [0,1].
- `obj.SetAlphaRange (double , double )` - Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
- `obj.SetAlphaRange (double a[2])` - Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
- `double = obj. GetAlphaRange ()` - Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
- `obj.GetColor (double x, double rgb[3])` - Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
- `double = obj.GetOpacity (double v)` - Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.
- `vtkIdType = obj.GetIndex (double v)` - Return the table index associated with a particular value.
- `obj.SetNumberOfTableValues (vtkIdType number)` - Specify the number of values (i.e., colors) in the lookup table.
- `vtkIdType = obj.GetNumberOfTableValues ()` - Specify the number of values (i.e., colors) in the lookup table.
- `obj.SetTableValue (vtkIdType indx, double rgba[4])` - Directly load color into lookup table. Use [0,1] double values for color component specification. Make sure that you've either used the Build() method or used SetNumberOfTableValues() prior to using this method.
- `obj.SetTableValue (vtkIdType indx, double r, double g, double b, double a)` - Directly load color into lookup table. Use [0,1] double values for color component specification.
- `double = obj.GetTableValue (vtkIdType id)` - Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] double values.
- `obj.GetTableValue (vtkIdType id, double rgba[4])` - Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] double values.
- `double = obj.GetRange ()` - Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
- `obj.SetRange (double min, double max)` - Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
- `obj.SetRange (double rng[2])` - Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
- `obj.SetNumberOfColors (vtkIdType )` - Set the number of colors in the lookup table. Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.
- `vtkIdType = obj.GetNumberOfColorsMinValue ()` - Set the number of colors in the lookup table. Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.
- `vtkIdType = obj.GetNumberOfColorsMaxValue ()` - Set the number of colors in the lookup table. Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.
- `vtkIdType = obj.GetNumberOfColors ()` - Set the number of colors in the lookup table. Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.
- `obj.SetTable (vtkUnsignedCharArray )` - Set/Get the internal table array that is used to map the scalars to colors. The table array is an unsigned char array with 4 components representing RGBA.
- `vtkUnsignedCharArray = obj.GetTable ()` - Set/Get the internal table array that is used to map the scalars to colors. The table array is an unsigned char array with 4 components representing RGBA.
- `obj.DeepCopy (vtkLookupTable lut)` - Copy the contents from another LookupTable
- `int = obj.UsingLogScale ()`