Keywords: front-page

## Lab: Pseudocolor Applications

[Exercises] [Workspace]

Purpose: The purpose of this lab is to demonstrate the use of autocoloring techniques to artificially assign colors to a grey scale image.

Activities:

1. Input a data set.

   1. Read and display the image $DIP/data/retina.kdf using operators User defined and Display Image .

      1. Glyphs:Input/Output:Data Files:User defined
      2. Glyphs:Visualization:Non-Interactive Display:Display Image

2. Inset a ramp grey scale into the image.

   1. Use operator Piecewise Linear to generate a 10 x 128 grey-level downward ramp, with values ranging from 0 to 255.

      1. Glyphs:Khoros 1:Generate Data:Piecewise Linear
      2. Open the Piecewise Linear operator and set the following parameters.

         Number Rows: 128

         Number Cols: 10

         Sampling Freq: 1

         Maximum Value: 255

         Y Period: 128

         Y Rise Time: 128

   2. Use the Flip operator to vertically flip the object ("Reflection Direction" = Height) so that the ramp has increasing values from bottom to top.

      1. Glyphs:Data Manip:Reorganize Data:Flip

   3. Use operator Convert Type to make the values "unsigned byte".

      1. Glyphs:Data Manip:Data Conversion:Convert Type

   4. Use operator Pad to create a border of width 1 pixel and of value 255 around the grey-scale image.

      1. Glyphs:Data Manip:Size & Region Operators:Pad
      2. Open the Pad operator and set the following parameters.

         Padded Width: 10+2

         Padded Height: 128+2

         Width Offset: 1

         Height Offset: 1

         Real Pad Value: 255

   5. Use operator Inset to overlay the ramp scale on the original image. Set the offset values so that the ramp scale does not obstruct critical areas in the image.

      1. Glyphs:Data Manip:Size & Region Operators:Inset

   6. Display the resultant image using the Display Image operator.

      1. Glyphs:Visualization:Non-Interactive Display:Display Image

3. Use the Autocolor operator to pseudocolor the image. Note that Autocolor adds a map to the image file and that the pixel contents displayed under the mouse in the Display Image operator show each pixel as an index. In this manner, although the image has been pseudocolored, the pixel index still contains the original grey value.

   1. Glyphs:Visualization:Map Display & Manip:Autocolor
   2. Open the Autocolor pane and select the "SA PSeudo" option

Exercises

1. Experiment with the different colortables. Some will enhance certain features more than others.
2. The "SA-Pseudo" colortable was published in Scientific American. What is its main feature?

Khoros Workspace
Execute the visual program c4s9pseudo-color.wk