imagej lookup tables skill - ms. barge's science classes

2
26 Discovering Image Processing ©2006 The Center for Image Processing in Education. Limited classroom reproduction rights are granted earlier in this work. What is a lookup table? Digital images are produced by matching numerical values to colored pixels using a lookup table (LUT). The diagram below shows this relationship. Manipulating the lookup table using the Brightness and Contrast (B&C) window Choose Image > Adjust > Brightness/Contrast to open the B&C window. The B&C window shows a histogram of the pixel values in the image and provides sliders to control how ImageJ maps pixel values to the lookup table. The following example shows how to enhance the contrast of an image using these controls. Lookup tables and image types Computers store and process information in the form of binary digits or bits. The number of bits that are used to represent each pixel in an image determines the number of possible values a pixel can have. ImageJ can work with 8-bit, 16-bit, and 32-bit grayscale images, as well as 8-bit and Lookup Tables ImageJ Skill image, the pixel values cluster near the center of the histogram. This corresponds to the middle shades of gray in the lookup table. Adjust the Minimum and Maximum slider controls to match the lookup table to the range of pixel values. To make the contrast change permanent, click the Apply button in the B&C window. Note: this changes the original pixel values! 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 3 8 9 5 5 5 8 3 0 0 0 0 0 0 0 7 9 12 6 4 4 5 6 11 13 3 0 0 0 0 8 6 4 10 5 4 10 10 11 12 12 11 7 0 0 8 12 6 5 4 4 6 12 12 11 15 12 11 6 3 2 11 12 10 11 4 4 10 12 11 11 11 12 10 5 4 7 6 12 12 10 1 4 13 10 14 14 14 14 6 4 4 4 6 15 12 4 1 8 13 8 14 14 14 14 8 4 4 5 5 11 5 1 3 9 14 14 14 13 10 13 1 1 4 5 4 6 5 1 3 13 14 14 14 7 7 8 1 1 4 4 4 4 6 10 3 7 13 14 13 2 3 9 7 4 4 7 5 4 9 12 9 2 7 14 9 2 3 7 4 9 4 2 5 4 5 14 9 3 7 14 9 3 2 3 13 10 7 0 7 5 4 10 9 3 3 10 9 3 3 8 10 13 2 0 0 7 4 10 4 1 3 4 3 3 1 4 8 3 0 0 0 0 7 6 7 3 3 3 3 1 7 7 2 0 0 0 0 0 0 3 7 7 7 7 7 7 3 0 0 0 0 Numerical values Lookup table Digital image pixels = picture elements, the small colored squares or rectangles that make up a digital image. Transfer function The diagonal line on the histogram in the B&C window represents the transfer function (equation) that mathematically relates pixel values to the lookup table. Clicking the Apply button uses the transfer function equation to convert the old pixel values to new pixel values. transfer function histogram = graph showing the number of pixels in an image with each different pixel value. Also called a frequency distribution chart. Number of Pixels 256 0 Pixel Value

Upload: others

Post on 12-Sep-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ImageJ Lookup Tables Skill - Ms. Barge's Science Classes

26 Discovering Image Processing©2006 The Center for Image Processing in Education.

Limited classroom reproduction rights are granted earlier in this work.

What is a lookup table?Digital images are produced by matching numerical values to colored pixels using a lookup table (LUT). The diagram below shows this relationship.

Manipulating the lookup table using theBrightness and Contrast (B&C) windowChoose Image > Adjust > Brightness/Contrast to open the B&C window. The B&C window shows a histogram of the pixel values in the image and provides sliders to control how ImageJ maps pixel values to the lookup table. The following example shows how to enhance the contrast of an image using these controls.

Lookup tables and image typesComputers store and process information in the form of binary digits or bits. The number of bits that are used to represent each pixel in an image determines the number of possible values a pixel can have. ImageJ can work with 8-bit, 16-bit, and 32-bit grayscale images, as well as 8-bit and

Lookup TablesImageJSkill

In the original low-contrast image, the pixel values cluster near the center of the histogram. This corresponds to the middle shades of gray in the lookup table.

Adjust the Minimum and Maximum slider controls to match the lookup table to the range of pixel values.

To make the contrast change permanent, click the Apply button in the B&Cwindow. Note: this changes the original pixel values!

0123456789

101112131415

0 0 0 0 3 8 9 5 5 5 8 3 0 0 0 00 0 0 7 9 12 6 4 4 5 6 11 13 3 0 00 0 8 6 4 10 5 4 10 10 11 12 12 11 7 00 8 12 6 5 4 4 6 12 12 11 15 12 11 6 32 11 12 10 11 4 4 10 12 11 11 11 12 10 5 47 6 12 12 10 1 4 13 10 14 14 14 14 6 4 44 6 15 12 4 1 8 13 8 14 14 14 14 8 4 45 5 11 5 1 3 9 14 14 14 13 10 13 1 1 45 4 6 5 1 3 13 14 14 14 7 7 8 1 1 44 4 4 6 10 3 7 13 14 13 2 3 9 7 4 47 5 4 9 12 9 2 7 14 9 2 3 7 4 9 42 5 4 5 14 9 3 7 14 9 3 2 3 13 10 70 7 5 4 10 9 3 3 10 9 3 3 8 10 13 20 0 7 4 10 4 1 3 4 3 3 1 4 8 3 00 0 0 7 6 7 3 3 3 3 1 7 7 2 0 00 0 0 0 3 7 7 7 7 7 7 3 0 0 0 0

Numerical values Lookup table Digital image

pixels = picture elements, the small colored squares or rectangles that make up a digital image.

Transfer functionThe diagonal line on the histogram in the B&C window represents the transfer function (equation) that mathematically relates pixel values to the lookup table.

Clicking the Apply button uses the transfer function equation to convert the old pixel values to new pixel values.

Apply button uses

transferfunction

histogram = graph showing the number of pixels in an image with each diff erent pixel value. Also called a frequency distribution chart.

Num

ber o

f Pix

els

2560Pixel Value

Page 2: ImageJ Lookup Tables Skill - Ms. Barge's Science Classes

ImageJ Skill Sheets 27©2006 The Center for Image Processing in Education.

ImageJ Skill Sheets©2006 The Center for Image Processing in Education.

ImageJ Skill Sheets ImageJ Skill SheetsLimited classroom reproduction rights are granted earlier in this work. ImageJ Skill Sheets

RGB Color andLookup TablesRGB Color images do not use lookup tables. Rather, they defi ne the color of each pixel using three values, one each for the Red, Green, and Blue brightness of the pixel. Since each pixel can have any of 256 possible values for red, green, and blue, there are a total of 256 x 256 x 256 or 16.7 million color combinations!

8-bit color8-bit color images are like “paint-by-number” pictures. Each image has a unique palette of up to 256 colors. In the same way that the colors from one picture may not work well for painting a diff erent scene, the lookup tables from 8-bit color images are not interchangeable. Thus, cutting and pasting between 8-bit color images usually does not work well. To combine 8-bit color images, you must fi rst convert each image to RGB color using Image >Type > RGB Color.

24-bit (RGB) color images. 8-bit images can have up to 256 different values, 16-bit images can have over 65 thousand values, and 32-bit images can have billions of possible values.

In ImageJ, all lookup tables contain a maximum of 256 colors. In 8-bit grayscale and color images, each value corresponds to one color of the lookup table. Since the human eye cannot distinguish billions, or even thousands of different colors, it would be pointless to use 16- or 32-bit lookup tables. Therefore, these images are displayed using an 8-bit lookup table, with each color representing a range of adjacent pixel values, rather than a single value.

The process of displaying 16- and 32-bit data using a 256-color lookup table is called windowing. In ImageJ, windowing is controlled using the Window and Level (W&L) panel. To open the W&L panel, choose Image > Adjust > Window/Level. The Window control determines the number of adjacent pixel values that the 256-color lookup table is applied to. The Levelcontrol sets the center pixel value of the range defi ned by the Windowcontrol. Pixel values above this range appear white, and values below the range appear black. The example below, using a 16-bit image of a galaxy, shows the use of the Window and Level controls.

Using a different lookup tableImageJ includes several built-in lookup tables and can open saved ImageJand NIH Image lookup tables. Lookup table fi les have a .lut fi le extension.

• Choose Image > Lookup Tables to use a built-in lookup table, and pick a lookup table from the list.

• Use File > Open… to open lookup table (.lut) fi les.

Combining images with different lookup tablesTo copy and paste between two images, or to combine multiple images into a montage or a stack, they must have the same lookup table. If they have different lookup tables, change the image type of all images involved in the operation to 8-bit grayscale (Image > Type > 8-bit) or RGB color (Image > Type > RGB Color).

The original 16-bit image contains more information than a 256-color lookup table can display eff ectively. As a result, only the bright center of the galaxy and a nearby star can be seen.

By narrowing the window and adjusting the level, additional detail can be seen in the central region of the galaxy.

Narrowing the window further shows more detail in the faint, outer parts of the galaxy. The inner part of the galaxy is now outside the range of the lookup table, and appears “overexposed.”

bit = “binary digit”bit = “binary digit”bit

Bits and colors4 bits = 24 = 16 colors

8 bits = 28 = 256 colors

16 bits = 216 = 65,536 colors

32 bits = 232 = 4.3 billion colors

Combining the two 8-bit color images above does not produce the desired result (below left). Converting the images to RGB color before combining them produces the appropriate result (lower right).