LUT Encoding

Modality LUT

A "Modality LUT " allows the transformation of manufacturer-dependent pixel values into manufacturer-independent pixel values (e.g., Hounsfield units for CT images). The "Modality LUT" may be contained within an image, a presentation state (that references an image), or as a "Standalone Modality LUT" (that references an image). "Rescale Slope" (0028,1053) and "Rescale Intercept" (0028,1052) are used to describe the transformation when it is linear, while the "Modality LUT Sequence" (0028,3000) is used to describe non-linear transformations. In both cases it is implied that the transformation can only occur for grayscale data (images with "Photometric Interpretation" values of "MONOCHROME1" and "MONOCHROME2").

LEADTOOLS provides functionality to manipulate the "Modality LUT". The GetModalityLUTAttributes method and the SetModalityLUT method (along with the ModalityLUTAttributes property) can be used to retrieve and update the values of the elements that describe a "Modality LUT". The properties specified by the ModalityLUTAttributes property describe all the attributes related to a "Modality LUT".

If the transformation defined by the LUT is linear then the IsRescaleSlopeIntercept property is TRUE and the RescaleIntercept property, the RescaleType property and the RescaleSlope property will hold the values for "Rescale Intercept" (0028,1052), "Rescale Type" (0028,1054) and the "Rescale Slope" (0028,1053) respectively.

If the transformation defined by the LUT is nonlinear the IsModalityLUTSequence property is TRUE, the ModalityLUTType property specifies the value of the "Modality LUT Type" (0028,3004) element, the LUTExplanation property specifies the value of the "LUT Explanation" (0028,3003) element, and the values of the "LUT Descriptor" (0028,3002) are specified by the LUTDescriptorNumberOfEntries property, the LUTDescriptorFirstMapped property, and the LUTDescriptorEntryBits property. To get the "LUT Data" (0028,3006) under the "Modality LUT Sequence" (0028,3000) use the GetModalityLUTData method. To remove the "Modality LUT " from a DICOM Data Set call the DeleteModalityLUT method.

VOI LUT

A "VOI LUT" allows the transformation of the modality pixel values into pixel values that are meaningful for print or display. This transformation is applied after any "Modality LUT". The "VOI LUT" may be contained within an image, or a presentation state (that references an image), or as a "Standalone VOI LUT" (that references an image). "Window Center" (0028,1050) and "Window Width" (0028,1051) are used to describe the transformation when it’s linear, while the "VOI LUT Sequence" (0028,3010) is used to describe non-linear transformations. In both cases it is implied that the transformation can only occur for grayscale data (images with "Photometric Interpretation" values of "MONOCHROME1" and "MONOCHROME2"). If multiple values are present for the "Window Center" and "Window Width", both attributes shall have the same number of values and shall be considered as pairs. Multiple values indicate that multiple alternative views may be presented. If multiple items are present in the "VOI LUT Sequence" (0028,3010), only one may be applied to the image for display. Multiple items indicate that multiple alternative views may be presented.

LEADTOOLS provides functionality to manipulate the "VOI LUT ". The WindowCount property specifies the number of values under the "Window Center" and "Window Width" elements, while the VOILUTCount property specifies the number of items under the "VOI LUT Sequence" (0028,3010). Use the GetWindowAttributes method and the SetWindowAttributes method (along with the WindowAttributes property) to retrieve and update the attributes that describe "Window Center" (the WindowCenter property), the "Window Width" (the WindowWidth property), and the "Window Center & Width Explanation" (the WindowCWExplanation property). If you want to delete all the elements related to a linear "VOI LUT" call the DeleteWindow method.

If the "VOI LUT" is non-linear, you can use the GetVOILUTAttributes method (together with the VOILUTAttributes property) to get the format of the "LUT Data" under the "VOI LUT Sequence" and you can use the GetVOILUTData method to get the table data ("LUT Data") itself.

When the GetVOILUTAttributes method is called to retrieve the attributes of a VOI LUT, the properties of the VOILUTAttributes property are updated with the retrieved values.

When setting the attributes of a VOI LUT, the properties of the VOILUTAttributes property should be set to the desired values before calling the SetVOILUT method. The VOILUTAttributes property returns a reference to the LVOILUTAttributes object. This object exposes the ILVOILUTAttributes interface which defines properties for the attributes of VOI LUTs. For more information regarding the properties available through this interface, refer to Working With The LVOILUTAttributes Object.

To set the "LUT Data" use the SetVOILUT method which will set both the format of the data and the data itself. If you want to delete all the elements related to a non-linear "VOI LUT" call the DeleteVOILUT method.

Palette Color Table

A "Palette Color Lookup Table" is used inside 8 and 16 bit color images where the pixel value is used as an index into each of the Red, Blue, and Green Palette Color Lookup Tables (0028,1101-1103 &1201-1203). The DICOM standard defines two types of tables: "Contiguous Palette Color Tables" where the data for each table is represented by a single contiguous stream and "Segmented Palette Color Tables" where the data is stored in each table as a series of segments. Both types are supported by the toolkit.

LEADTOOLS provides functionality to manipulate a "Palette Color Table". You can use the GetPaletteColorLUTAttributes method and the SetPaletteColorLUTAttributes method (in conjunction with the PaletteColorLUTAttributes property) to retrieve the attributes that describe a "Palette Color Lookup Table" and to set them.

When the GetPaletteColorLUTAttributes method is called to retrieve the attributes of the Palette Color LUT, the various properties of the PaletteColorLUTAttributes property are updated with the retrieved values.

When setting the attributes of the Palette Color LUT, the properties of the PaletteColorLUTAttributes property should be set to the desired values before calling the SetPaletteColorLUTAttributes method.

The PaletteColorLUTAttributes property returns a reference to the LPaletteColorLUTAttributes object. This object exposes the ILPaletteColorLUTAttributes interface which defines for the attributes of Palette Color LUTs. For more information regarding the properties available through this interface, refer to Working With The LPaletteColorLUTAttributes Object.

The GetPaletteColorLUTData method can be used to get the table entries under the "Red", "Green" or "Blue" "Palette Color Lookup Table Data", while the SetPaletteColorLUTData method can be used to set them. To remove the "Palette Color Lookup" tables from a DICOM Data Set call the DeletePaletteColorLUT method.