Title: Visualization Part II Data Explorer
1Visualization - Part IIData Explorer
- Karen G. Haines
- Brian Oetiker
2Data Explorer
- Selecting Data Components
- Coloring (Autocolor, Color)
- Exporting Images
- Times series data (importing, exporting)
- Adding captions
- Exporting time series images
3Selecting and Collecting Data
- Required when altering specific data components
- The Select module is used to extract a data
component - The Collect module is used to group or regroup
the data values or images - Also can use the Arrange module to put images
in order once data/images are collected
4Previous Plotting Example
- Values were displayed, but colors of the line
plots were the same - Need a legend to define the results viewed
- a legend differs from axis
- Results were not saved to an output file
5Previous Plot ProgramExercise 5
6Previous General Array File C/Windows/Desktop/DX
_Class/Examples/2D_Plots/Ex4.general
7Previous Plot Results
8Exercise 6Selecting Data Components
- Reopen VP from previous lecture
- C/Windows/Desktop/DX_Class/Examples/2D_Plots/Ex5.
net - Create a Select module for each data component
and connect output of the Import to each module - Open the Select module dialog and enter the
appropriate component under the which input - which Professors or Students
- Case sensitive
- Component names should correspond to names in GAF
file (Ex4.general)
9Exercise 6Coloring and Labeling Data Components
- Create a Color module for each data component
and connect output of the Select to each module - Open the Color module dialog enter a different
color for each data component - Create an Options module for each data
component and connect output of the Color to
each module - Set the appropriate options in the Options
module - attribute1 label
- value1 professors or students
10Exercise 6Regrouping Data Components
- Create a Collect module and connect the output
of both Options modules to the input of
Collect - Connect the output of the Collect module to the
input of the Plot module - Execute the program
11New Plotting Program
12Colored Plot with Labels
13Rendering an Image
- Output of Image module is a renderable object,
but it is not a rendered image - Can save the image by hand using Save Image
under the File menu options in the Image
window - To create an image, need to first render the
image using the Display or Render modules - Both modules require camera component inputs
14Rendering
- Uses a specified camera to create an image of an
object - Rendering properties of an object (shading) can
be changed with the Options of Shade modules - Render always invokes the software renderer
- By default, creates 96-bit images
- Creates 24-bit images if the DXPIXELTYPE
environment variable is set to DXByte - setenv DXPIXELTYPE DXByte
15Display
- Displays an image or renders and object an
displays an image - If a camera is not specified, the system assumes
the input object is an image to be displayed - Must use the Image module rather than Display
if you want an inter-active display environment - With Display, DX automatically selects the
hardware-appropriate rendering format
16Exercise 6Rendering an Image
- Create a Render module
- Connect the first output of Image (the image)
to the first input of the Render module - Connect the second output of Image (the camera)
to the second input of the Render module
17Exercise 6Rendering an Image
18Writing an Image to an Output File
- Once an image is rendered, it can be written to
disk in various formats using the WriteImage
module - A variety of standard image file formats are
supplied - Gif, Tiff, RGB, YUV, eps-color, eps-greyscale
- Need to have permission to the directory where
the image is to be saved
19Exercise 6Writing an Image
- Create a WriteImage module
- Connect the output of Render to the input of
WriteImage - Invoke the WriteImage dialog box
- Select the gif output file format
- Enter the name of the output file with no
extension - C/Windows/Desktop/DX_Class/Examples/2D_Plots/plot
20Final 2D Plot Program
- Execute the program to make sure it is working
correctly - Save the resulting program
- C/Windows/Desktop/DX_Class/Examples/2D_Plots/Ex6
21Final 2D Plot Program
22Importing and Displayingan Image
- To import an image in a format known to DX, use
the ReadImage - To view an image that has already been rendered,
use the Display module
23Exercise 7Displaying Images
- Invoke a new VP
- Create a ReadImage and a Display module
- Connect ReadImage to Display
- Think data flow
- Input the name of the image file created in the
previous exercise - C/Windows/Desktop/DX_Class/Examples/2D_Plots/plot
.gif - Execute the program
- Save program
- C/Windows/Desktop/DX_Class/Examples/2D_Plots/Disp
lay
24Exercise 7Displaying Images
25Visualizing 2D Time Series Data
- Best method for representing time series data is
animation - For 2D time series data, DX can be used to create
a series of output images that can be used to
create an animation - A variety of output standard image formats are
provided
26Importing an Image Series
- Example data file information
- 60 10 x10 2D block data values stored
sequentially - data type of values is float
- data depicts 2D population values over time
- file
- C/Windows/Desktop/DX_Class/Examples/timesSeries/i
mages.foxP
27Exercise 8Importing 2D Time Series Data
- Invoke the Data Prompter
- Select Grid or Scattered file
- Regular grid
- variables 1
- make sure single time step is deselected
- Data organization is block
- Data file
- C/Windows/Desktop/DX_Class/Examples/timeSeries/im
ages.foxP
28Exercise 8Describing 2D Time Series
- Grid 10 x 10
- Format ASCII
- Order Column
- Series
- n 60 start 1 delta 1
- Field
- name foxes
- type float
- Save file
- C/Windows/Desktop/DX_Class/Examples/timeSeries/fo
xP
29Visualizing 2D Time Series Data
- Need to process each time slice of data
consecutively to create a series of output images - Requires a means for accessing each slice of data
one at a time - Data representation must remain consistent for
the entire data set
30Exercise 9Displaying 2D Data
- Invoke the VPE (new program)
- Add the modules
- Import ? RubberSheet ? Image
- Input the file previously created
- C/Windows/Desktop/DX_Class/Examples/timeSeries/fo
xP.general - Execute the program
- Investigate different views
31Exercise 9Displaying 2D Data
32Problems with Current Visual Program
- Sequenced data not viewable as a time series
- Colors do not optimally represent the data
- Output images are not created
33Adding the Sequencer
- Loading in the data all at once limits DX
- Need to import the images one by one in
sequential order - Use the Sequencer module to control the
processing of sequential images - Sequencer basically generates a sequence of
integers and has attributes to control the count
34Exercise 9Add the Sequencer
- Create a Sequencer module
- Expand the dialog for the Import module, apply
the change, then close dialog - Start, End, Delta
- Connect the Sequencer output to the fourth
(start), fifth (end), and sixth (delta) tabs of
the Import module - Execute the sequencer
35Exercise 9Add the Sequencer
- Change the execution mode to sequencer
- Access the series control attributes by clicking
on the ellipsoids on the Sequencer control
panel - Change the maximum number of images to 59
- Execute the program
36Exercise 9Add the Sequencer
37Adding Color
- Current visual program does not best represent
the data - need to have color control - Need a means of color control
- Modules for coloring include AutoColor and
Color
38Autocolor Module
- Automatically colors a data field by mapping hues
to data - Adds colors to the color component
- Adds a color map attribute to output object
- Color map component is created
- color look up table with 256 entries
39Exercise 9Automatic Coloring
- Create an Autocolor module
- Connect the output of Rubbersheet to the input
of AutoColor - Connect the output of AutoColor to the input of
Image - Execute the program
40Exercise 9Automatic Coloring
41Autocolor with Time Series Data
- AutoColor module uses minimum and maximum data
values to create a color map - typically red maximum blue minimum
- Problem with using AutoColor module with time
series data is that the color mapping changes
each with image
42Constant Color Control
- To retain the color representation for the entire
series - Control requires the use of two modules
- Colormap and Color
- Colormap is a means of creating a specific map
of colors - Color colors the data
43Exercise 9Color and Colormap
- Delete AutoColor module
- Create a Color and a Colormap module
- Connect the output of Rubbersheet to the first
input tab of Color and the output of Colormap
to the second input tab of Color - Connect the output of Color to the input of
Image - Set the maximum value of the colormap to 10.0
- Execute the program
44Exercise 9Color and Colormap
45Captions
- Caption module is used to display a caption on
a screen - Can change the color of the caption using the
Color module - When using Image or Display changing the size
of the image will not affect the size of the
caption - need to use ScaleScreen to change caption size
46Exercise 9Adding Captions
- Create a Caption module
- Invoke and expand the Caption dialog to set the
following parameters - string Total Student Population
- position 0.5 0.95
- height 48
- font roman_s
47Exercise 9Adding Captions
- Create a Collect module
- Connect the output of Color and the output of
Caption to the inputs of Collect - Connect the output of Collect to the imput of
Image - Execute the program
48Exercise 9Adding Captions
49Creating a Series of Output Images
- Before an image can be written, it must be
rendered - When working with time series output, want any
output time slice to correspond to its respective
input time slice - Need a means of formatting the outfile names as
the function of the sequence
50Rendering an Image Revisited
- Two modules to render an image
- Display
- Render
- Both need camera coordinates
- Camera coordinates can be directly sourced from
image
51Exercise 9Rendering an Image
- Create a Render module
- Connect the first output of Image (the image)
to the first input of the Render module - Connect the second output of Image (the camera)
to the second input of the Render module - DO NOT EXECUTE THE PROGRAM
52Exercise 9Rendering an Image
53Creating a Series of Filenames
- Sequencer generates a stream of integers
- Format module formats a string
- To create a list of file names that are in
synchronization with the Sequencer, the output
of the sequencer is used as input into a
Format module to generate a string much like
the C programming language
54Exercise 9Creating a Series of File Names
- Create a Format module
- Connect the output of Sequencer to the second
input of Format (the value) - Invoke the Format dialog and set the template
- C/Windows/Desktop/DX_Class/Examples/timeSeries/im
age.d.gif
55Exercise 9Creating a Series of File Names
56Creating a Series of Output Files
- At this point we have
- a series of rendered images
- a series of file names
- To generate sequential output image, all that
needs to be done is to create a WriteImage
module and connect the images and filenames to
module
57Exercise 9Creating a Series of Output Files
- Create a WriteImage module
- Connect the output of Render to the first input
tab of WriteImage - Connect the output of Format to the second
input tab of WriteImage - Execute the program
- Save the program
- C/Windows/Desktop/DX_Class/Examples/timeSeries/Ex
9
58Exercise 9Resulting Program
59(No Transcript)