Purpose

The module TableLUT generates a lookup table (LUT) object from a table of sampling points (as a string), each consisting of an index value and up to four channel values.

Different methods for the interpolation of the LUT entry values between the sampling points are available.

Usage

Specify a list of LUT sampling points in the Sampling Points field, press Apply and connect the outLUT output field to a SoMLLUT module to use the LUT in a 2D/3D viewer, or to an ApplyLUT module to apply the LUT to an ML image.

Details

Table Format

The sampling points table consists of at least two sampling points separated by newline, comma, forward or backslash characters. The values for each sampling point entry are separated by spaces. Each sampling point entry must consist of one index and one to four channel values. All sampling point entries must contain the same number of values. The sampling points must be sorted in increasing index value order.

Visual Type

The visual type of the output LUT depends on the number of channel entry values specified for each sampling point:

Channels Visual Type Description
1 L Single luminance channel
2 LA Luminance and alpha channels
3 RGB Red, green and blue channels
4 RGBA Red, green, blue and alpha channels

Interpolation

If Color Interpolation is set to Constant, the intervals between two sampling points are filled by repeating the values at the lower interval bounds. In the other interpolation modes, a linear interpolation is performed for the luminance and alpha values. For color values, interpolation can be performed in either the RGB or the HLS color space. The HLS color space represents a color by its hue, arranged circular in the order red-yellow-green-cyan-blue-magenta-red, its lightness, and its saturation. With respect to the hue, the interpolation is performed either in positive or negative circular direction.

See LUT Functions for general information about ML lookup tables.

Windows

Default Panel

../../../Modules/ML/MLLUTTools/mhelp/Images/Screenshots/TableLUT._default.png

Output Fields

outLUT

name: outLUT, type: LUTFunction(MLBase)

Parameter Fields

Field Index

Color Interpolation: Enum
Index Range Reference: Enum
Max Value: Double
Min Value: Double
Sampling Points: String
Status: String
Valid: Bool

Visible Fields

Index Range Reference

name: indexRangeReference, type: Enum, default: RelativeTo01

Defines whether the generated LUT is absolute or relative and how the index values specified in the sampling points table are related to the LUT index range.

Values:

Title Name Description
Absolute Absolute The LUT is absolute and defined for the index range as specified in the sampling points table.
Relative To [0,1] RelativeTo01 The LUT is relative and defined for the index range [0, 1]. The function defined by the sampling points table is restricted to the interval [0, 1], the part of the function outside of this interval is ignored.
Relative To Table Range RelativeToTableRange The LUT is relative and defined for the index range [0, 1]. The index value range specified in the sampling points table is mapped to the interval [0, 1].

Sampling Points

name: samplingPoints, type: String, default: 0 0 0 0 1, 1 1 1 1 1,

Sets the sampling points as a string.

Color Interpolation

name: colorInterpolation, type: Enum, default: RGB

Defines how the interpolation of the LUT values between two consecutive sampling points takes place.

For luminance and alpha channels, the RGB and HLS interpolations are identical.

Values:

Title Name Description
Rgb RGB Interpolation is performed on red, green and blue values.
Hls HLS Interpolation is performed on hue (shortest circular distance), lightness and saturation values.
HLSpositive HLSpositive Interpolation is performed on hue (positive circular distance), lightness and saturation values.
HLSnegative HLSnegative Interpolation is performed on hue (negative circular distance), lightness and saturation values.
Constant Constant Interpolation is performed by replicating the LUT values of the next lower sampling point.
Srgb SRGB Interpolation is performed in the sRGB color space.

Min Value

name: minValue, type: Double, default: 0

Sets the minimum value relative to which the channel values in the sampling points table are specified.

This value must be smaller than Max Value.

Max Value

name: maxValue, type: Double, default: 1

Sets the maximum value relative to which the channel values in the sampling points table are specified.

This value must be smaller than Min Value.

Valid

name: outLUTValid, type: Bool, persistent: no

Shows whether the specified parameters provide a valid LUT definition.

Status

name: status, type: String, persistent: no

Shows information about the status of the module.

It shows the string NoError if the LUT is valid, and an error string if it is invalid.