ApplyLinearModalityLUT Method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

 

Syntax

short ApplyLinearModalityLUT (LPDispatch pRaster, double dIntercept,double dSlope, ModalityLUTConstants Flags);

Overview

Refer to Examining and Altering Bitmaps.

Remarks

Remaps the bitmap pixels by applying a linear transformation described by rescale slope and intercept. In DICOM this is referred to as "applying a linear Modality LUT".

This method will remap the bitmap pixels by applying the linear transformation described by the equation:

Y = mX + b

m: slope of a straight line, this is also referred to as "Rescale Slope" in the DICOM world.

b: the y-intercept of a straight line, this is also referred to as "Rescale Intercept" in the DICOM world.

Y: the resulting pixel value.

X: the input or original pixel value.

This method is helpful in applying what is referred to as a "Linear Modality LUT" in the DICOM world. According to the DICOM standard a "Modality LUT" defines the transformation of manufacturer-dependent pixel values into pixel values, which are manufacturer independent (e.g. Hounsfield units for CT, Optical Density for film digitizers, etc.).

This method only works on grayscale bitmaps. Calling this function for non-grayscale bitmaps will return an error .

It’s recommended to always set the M_LUT_UPDATE_MIN_MAX flag.

This method could change the bitmap from signed to unsigned or from unsigned to signed, this is determined by the values of the resulting image pixels after applying the linear transformation.

Only the useful bits in the bitmap are considered. The values are considered as if the bitmap pixel values are normalized so LowBit = 0.

This function supports signed data images.

If M_LUT_ALLOW_RANGE_EXPANSION is set in Flags, consider the following example:

If the bitmap has the following attributes:

Bits per pixel 16
High Bit 11
Low Bit 0
Pixel Range 0 to +4095,
Unsigned

The number of bits stored inside the bitmap is 11-0+1 =12.

If the dIntercept is set to –1024 and dSlope is set to 0, then after applying the rescale slope and intercept:

Output minimum pixel value = (0 * 1 +(-1024)) = -1024
Output maximum pixel value = (4095 * 1 + (-1024)) = 3071

The new pixel value range (–1024 to 3071) can’t be represented with the current bits stored (12 bits), which can represent values in the range (–2048 to 2048). In this case the method will change the high bit inside the bitmap handle to be 12 instead of 11 (bits stored becomes 13), which can represent values in the range (–8192 to 8191). Please note that the method won’t be able to update the high bit and/or low bit if the number of bits stored was already equal to the number of bits allocated.

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.

See Also

Elements:

RemapIntensity method, ApplyLinearModalityLUT method, ApplyVOILUT method, ApplyLinearVOILUT method

Topics:

Raster Image Functions: Modifying Intensity Values

 

Changing Brightness and Contrast