CountLUTColors method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int CountLUTColors(unsigned &nNumberOfEntries, int &nFirstIndex, unsigned uFlags);

Delphi Syntax

Function CountLUTColors (var nNumberOfEntries: L_UINT; var nFirstIndex: L_INT; uFlags: L_UINT): L_INT;

Overview

Refer to Changing Brightness and Contrast.

Remarks

Gets the total number of entries between the start color and the end color, and the index of the last occurrence of the start color. The start and end colors are determined internally.

Suppose you have a LUT with 4096 colors, the first 200 colors are black and the last 30 are white, the rest of the colors between black and white are gray. This is what the method will provide:

uNumberOfEntries :

3868.

nFirstIndex :

199.

In more detail this is:

Total number of entries: 4096 (0 – 4095)

First index of the end color: 4095 – 30 + 1 (+1 to add the first index of the end color to the range)

Number of occurrences of the starting color: 200 (0 – 199)

The last index of the start color: 199

Total number of entries: (4095 – 30 + 1) – 199 + 1

This method supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

This method supports signed data images.

See Also

Elements:

WindowLevel method, GetUserLookupTable method, RemapIntensity method, ApplyLinearVOILUT method.

Topics:

Raster Images: Modifying Intensity Values