AccessNET includes two image viewers, MedVIEW and MedVIEW WEB. Both support the display of grayscale images. A grayscale image is made up of pixels where each pixel is displayed as a shade of gray. The number of gray shades available depends on the display device. Typically display devices support 256 shades of gray. When a grayscale image is displayed, each image pixel value is swapped for one of the available display shades of gray using a lookup table (LUT). This lookup table is the Grayscale LUT. Technically the grayscale LUT is a one-dimensional array with a calculated display shade of gray value for each possible image pixel value. Hence a 16-bit grayscale image with a range of image pixel values from 0 to 65535 requires a grayscale LUT with 65536 calculated display shade of gray values – one for each possible image pixel value. Assuming the display device supports 256 shades of gray, each grayscale LUT value is a number from 0 to 255 inclusive. Getting the display value for any image pixel is simply a matter of indexing into the grayscale LUT at the image pixel value and using the calculated number stored at that location. Calculating grayscale LUT values includes three steps DICOM refers to as transformations. These include the Modality, VOI, and Presentation transformations.
The Modality transformation converts image pixels from modality values to modality-independent values. The conversion is accomplished in one of two ways. First the image or presentation may provide its own lookup table (Modality LUT). If so, the image pixel value is indexed into the table and the value stored at that location is the result. Otherwise, a calculation is made using the Rescale Slope and Rescale Intercept. Either way, the result is the output of the Modality transformation and also the input into the next step, the VOI transformation.
The VOI transformation converts image pixels to application values. This step is where the MedVIEW user has the most control of how the image is displayed. First the image or presentation may provide one or a series of lookup tables (VOI LUT). If so, MedVIEW displays the name associated with each table for the user to select from. Alternatively, the user may apply a Window Width and Level setting. This could be from a preset, the image or presentation, or manually selected with the Window Level Tool. If a VOI LUT is selected, the image pixel value is indexed into the selected table and the value stored at that location is the result. Otherwise, a calculation is made using the selected Window Width and Level. Note the Window Width and Level calculation may be accomplished using either a Linear or Sigmoid function. The result is the output of the VOI transformation and also the input into the next step, the Presentation transformation.
The Presentation transformation converts image pixels to display-independent values. Again, the image or presentation may provide a lookup table (Presentation LUT). If so, the image pixel value is indexed into the table and the value stored at that location is the result. Otherwise, the input value may inverted if the image is MONO1. The resulting value is then scaled to actual range of gray shades supported by the display.
After all possible image pixel values are calculated and stored in the Grayscale LUT, two more steps may be performed. First if the image provided min/max pixel value information, the LUT is updated to set all values outside the min/max range to the min/max calculated display values. Second if the image provided a pixel padding value or range of pixel padding values, the LUT is updated to display black at each pixel padding value. Finally the Grayscale LUT is complete and ready for use in image display. Note that the Grayscale LUT must be recalculated if the user makes any changes that affect the VOI transformation.
Next time we’ll discuss how we can use the Grayscale LUT to perform fast rendering in the web using WebGL.