[Exercises]
[Workspace]
Purpose:
The purpose of this experiment is to demonstrate how to build a
pseudo-color table suitable for images.
Activities:
-
Convert the image $DIP/data/head.kdf to "Unsigned Short" with
Convert Type operator and visualize with Display Image operator.
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Data Manip:Data Conversion:Convert Type
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
From the image $DIP/data/head.kdf, extract its maximum and
minimum values into the cantata variables "val_max" and "val_min"
respectively. Use the operator Print Stats.
-
Glyphs:Data Manip:Analysis & Information:Print Stats
-
Open the Print Stats menu and select the "Minima Value" and
"Maxima Value" parameters.
-
Build the sinusoidal color table.
-
Use the Sinusoid operator to build the Green component
of the color table.
-
Glyphs:Input/Output:Generate Data:Sinusoid
Width = 1
Height = val_max - val_min + 1
Height Phase Offset = -90
Other parameters (default)
-
Duplicate the Sinusoid operator to build the Blue component
of the color table.
-
Open the pane of the Sinusoid glyph and set the parameters
Width = 1
Height = val_max - val_min + 1
Height Phase Offset = 0
Other parameters (default)
-
Use the Negative operator connected to the Blue sinusoid component
to generate the Red component.
-
Plot these three sinusoidal signals using the Interactive 2D/3D Plot glyph
-
Glyphs:Visualization:Plot Display:Interactive 2D/3D Plot
-
Before running this network, to assure that the variables "val_min"
and "val_man" are set before the Sinusoid glyphs, connect the output
control connection of Print Stats to the input control connections of
the Sinusoid glyphs.
-
Append these three signals together in the Width dimension in the
following order: Red, Green and Blue. Use the Append operator.
-
Glyphs:Data Manip:Size & Region Operators:Append
-
Open the Append glyph and select the width dimension to append the
signals
-
Normalize and convert the data to "unsigned byte" in the range
of 0 255, using the Normalize operator
connected to the output of the Append operator.
-
Glyphs:Data Manip:Data Conversion:Normalize
-
Open the Normalize operator and set "Unsigned Byte" as the output
data type.
-
Append this normalized color table to a constant color table with
zeros with
size 3 x "val_min"
-
Glyphs:Input/Output:Generate Data:Constant
-
Open the Constant glyph and set the parameters
Width = 3
Height = val_min
-
Connect the output control connection of the Print Stats glyph
to the input control connection of the Constant glyph.
-
Duplicate the Append glyph, connect the output of the Constant glyph
to its first input and the output of the Normalize glyph to its
second input. Open its pane and set "Height" as the dimension to append
the data.
-
Convert this data into a Map colortable using the Copy from Value
operator and display the colortable using the Display Palette operator.
-
Glyphs:Data Manip:Segment Operators:Copy from Value
-
Glyphs:Visualization:Map Display & Manip:Display Palette
-
Open the Copy from Value glyph and select "Map" and the segment to
copy the data to.
-
Apply this colortable to the "Unsigned Short" image. Use the
following glyphs:
-
Glyphs:Data Manip:Segment Operators:Insert Segments
-
Glyphs:Data Manip:Map Operators:Map Data
-
Glyphs:Data Manip:Object Attributes:Set Attribute
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Open the Set Attribute operator and select RGB as the color model
Khoros Workspace
Execute the visual program c4s10build-pseudo-color.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved