WindowLevelFillLUT method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int __fastcall WindowLevelFillLUT (unsigned crStart, unsigned crEnd, int nLow, int nHigh, int nLowBit, int nHighBit, int nMinValue, int nMaxValue, bool bInside);

Delphi Syntax

Function WindowLevelFillLUT (crStart: TColorRef; crEnd: TColorRef; nLow: Longint; nHigh: Longint; nLowBit: Integer; nHighBit: Integer; nMinValue: Longint; nMaxValue: Longint; bInside: Boolean): Integer;

Overview

Refer to Examining and Altering Bitmaps.

 

Remarks

(Medical Imaging only) Maps grayscale intensities to a specified color range, and fill the LevelLUT property with these values.

Note:

This method only works for 12 or 16 bit grayscale images. Trying to use this method with other images will result in an error.

For example, suppose you are working with a 12-bit grayscale image. There are 4096 intensity levels in a 12-bit image (2 raised to the 12th power). Normally, the interval between 0 and 4095 would be mapped to colors between (0, 0, 0) and (255, 255, 255). With this method, any value that falls between nLow and nHigh will be mapped to colors between the start color and the end color. If you do not want a color gradient, set the start color equal to the end color.

If you only want to map the values between 1972 and 3273 (in a 12-bit image), then set nLow to 1972, set nHigh to 3273, and set bInside to TRUE. To map the values less than 1972 and greater than 3273, set bInside to FALSE.

See Also

Elements:

WindowLevel method, GetWindowLevel method, LevelLUT property