3.8 Tasks and Tools
The following examples illustrate a number of techniques and tools that
are helpful in using Data Explorer.
Adding Captions
The Caption tool allows you to control the
placement, font, size, wording, and other aspects of a
caption in the Image window.
- Open visual program .../Caption.net.
- Select Open All Control Panels in the
Windows pull-down menu.
A control panel appears.
- Select Execute on Change in the
Execute pull-down menu.
When the image appears, note that the caption at the bottom of the
Image window is the same as the name of the realization
technique shown in the control panel.
- Click on the option button in the control panel and select
Streamlines.
Both the image and the caption change accordingly.
Use the Caption configuration dialog box to change
the placement and font size of the caption.
- Double click on the Caption icon to open the
configuration dialog box and click on the
position toggle
button.
- Clear the
position parameter field and type "0 1".
- Click on OK.
The caption moves from its default position to the top left corner of
the Image window.
Note: [0 0] specifies the bottom left corner and [1
1] the top right.
- Reopen the Caption configuration dialog box and click on
Expand to show the hidden
parameters.
- Click on the height toggle
button.
- Double click on the associated parameter field to highlight the
value there.
- Type a larger value in its place (e.g., if the value was "15,"
type in "20").
- Click on OK.
The caption type changes size.
(See "Displaying and hiding parameters".)
To change the wording of a caption, you must use the
Format tool:
- In the VPE window, disconnect the Caption
input from the Selector interactor.
- Select Annotation and
Format in the
palettes.
- Position the Format icon between
Selector and
Caption
and open the configuration
dialog box.
- Drag the cursor over "(none)" in the template
parameter field and then type "Visualization Method: %s"
in its place (%s indicates that a string will be
inserted).
- Click on OK.
- Connect the second output tab of Selector to
the second (middle) input tab of Format.
- Connect the Format output to
Caption and reexecute the
visual program.
The caption reads "Visualization Method: Streamlines."
See Caption and Format in IBM Visualization Data Explorer User's
Reference.
Adding Input Tabs to Tool Icons
Tools such as Compute,
Options,
and Switch, among others, can have a variable
number of inputs.
If you need more tabs than the number shown by a default icon, you can
increase the number:
- Select the tool icon to which you want to add tabs.
- Select Input/Output Tabs in the
Edit pull-down menu and select
Add Input Tab in the
cascade menu.
An input tab is added to the icon.
- Repeat Step 2 as many times as necessary.
Note: You can also remove tabs from a tool icon by following the
same procedure, but select Remove Input
Tab in Step 2.
Connecting Scattered Data Points
Many Data Explorer modules cannot be used with scattered data points that have
no connections (i.e., interpolation elements).
However, Data Explorer does provide two methods for creating connections between
scattered data values.
- The first method uses the Connect module.
- The second method uses the Regrid module.
See Connect and Regrid in IBM Visualization Data Explorer User's
Reference.
Controlling Execution with Switch
Switch allows you to decide which portions of a
visual program are executed (e.g., whether a data set is
visualized with Isosurface or
MapToPlane).
- Open visual program .../Switch.net.
- Select Execute on Change in the
Execute pull-down menu.
The image that appears is a streamline representation of the
data set.
- Select Open All Control Panels in the
Windows pull-down menu.
You can now use the selector interactor to switch from one
visualization to the other.
You can modify the selector interactor and increase the number of
choices.
- Double click on the interactor to open the Set Selector
Attributes dialog box.
- Double click on the Value parameter field and
type "3" in that space.
- Double click on the Label parameter field
and type "MapToPlane." in that space.
Note: The integer passed from Selector to
the first
input tab of Switch determines what input,
if any, is passed on to another module.
If the integer is "0" or greater than the number of objects being
passed to the module, the output is NULL.
Thus, "1" selects the first input (second input tab), "2" the
second input (third input tab), and so on.
- Click on Add.
A new third line should appear under the first two.
- Click on OK to close the dialog box.
If you click on the option button in the selector, you will see that it
now offers a third choice.
Leave the control panel open.
The third choice shown in the Selector, however, is not yet operative
(select MapToPlane in the control panel and
reexecute the visual program).
To implement this choice, you must incorporate a third visualization
in the program, such as that represented by the program segment
on the right side of the VPE canvas.
This segment computes a MapToPlane of temperature data.
- Click on the Switch icon to highlight it.
- Select Add Input Tab in the
Edit pull-down menu.
A new input tab is added to Switch.
- Connect the first ("mapped") output tab of the
AutoColor icon (below the
MapToPlane icon) to the new input tab of
Switch.
- Select MapToPlane in the control panel and
reexecute the visual program.
The MapToPlane visualization appears in the Image
window.
Note: Switch selects among inputs.
The corresponding module that selects among outputs is Route.
Both are described in IBM Visualization Data Explorer User's
Reference.
Controlling Inputs: Configuration Dialog Boxes
A configuration dialog box allows you to change the parameter values of
a module.
To open the dialog box, double click on the module's icon or
single-click on the icon and select Configuration
from the Edit pull-down menu.
You can close the dialog box by clicking on OK.
Changing parameter values
A configuration dialog box displays the input parameters of a module.
You can change a parameter value by typing in a new value in the
corresponding parameter field on the right side of the
dialog box.
Note: If a tab is already connected to an arc, you must first
disconnect
the arc before typing in a new value.
Displaying and hiding parameters
Most configuration dialog boxes can be "expanded" to display
"hidden" parameters for less commonly used functions.
If a dialog box has hidden parameters, the Expand
and Collapse buttons at the bottom of the box
are enabled (i.e., their labels appear in solid type;
otherwise, both labels are gray).
To display hidden parameters, click on the Expand
button.
To restore the dialog box to its previous state, click on
Collapse.
Notes:
- Whether a parameter is hidden or visible is determined by the
associated toggle button in the Hide
column of the dialog box.
- The number of input tabs on an icon varies with the number of
visible parameters in the dialog box.
Controlling Inputs: Interactors
Using a configuration dialog box to specify tool inputs can be awkward,
especially if the inputs are changed frequently or if the number of
inputs is large.
A simpler means of controlling input values makes use of
interactors, which appear only in Control
Panels.
They are represented on the VPE canvas by stand-ins, or
icons, selected from the category and tool palettes just as
tools are.
The output of an interactor, like that of any tool, can be connected
to one or more inputs.
For this part of Tutorial II, you will use a scalar interactor
stand-in to control an isosurface value.
A scalar interactor can control any parameter that accepts a scalar
value as input.
Other types of interactor (e.g., vector, integer, string) can control
parameters that take the corresponding type of input.
Begin by opening visual program .../Isosurface3D.net.
Selecting interactors and placing stand-ins
The procedure here is essentially the same as that for selecting tools
and placing icons (see "Selecting tools and
placing icons").
- Select Interactor in the categories palette.
- Select Scalar in the tools palette and position
the cursor (now an inverted "L")
above Isosurface.
- Click again.
The stand-in for the Scalar interactor appears.
Connecting the interactor
- Click and hold on the Scalar output tab and drag
the cursor to the middle Isosurface input tab
(which lights up when the cursor touches it).
- Release the mouse button to establish a connection (represented by
a rectilinear black line) between the two.
Creating a control panel
Double click on the Scalar icon.
A control panel appears containing a scalar interactor labeled
Isosurface value.
Stepper arrowheads can be used to change this value.
Setting the interactor attributes
To set interactor attributes, you must open a
Set Attributes...
dialog box by:
- double clicking on the interactor in the control panel
or
- selecting Set Attributes... in the
Edit pull-down menu of the
control panel.
When the dialog box appears, you are ready to (re)set the
attribute values:
- Click on the Maximum field.
The value disappears.
- Type 1 and press Enter to set the
new value.
- Repeat Steps 1 and 2 for Minimum, and change
the value to .1.
- Repeat Steps 1 and 2 for Global Increment and
change the value to .01.
- Repeat Steps 1 and 2 for Decimal Places and
change the value to 2.
(You can also reset this value with the stepper buttons.)
- Click on OK.
The dialog box closes.
When the minimum and maximum values are set, Data Explorer will prevent
values outside that range from being entered.
Note: As discussed in "Data-driven Tools",
data-driven
interactors derive their own minimum and maximum from the
data itself.
Executing the program on change
- Select Execute On Change in the
Execute pull-down menu of the
VPE menu bar.
- Use the right-hand stepper arrowhead in the interactor to increase
the isosurface value.
As the value changes, so does the image in the Image window.
Notes:
- You can also change the isosurface value by clicking on it, typing
in a new value, and Pressing Enter.
- You can accelerate the value change by holding down the mouse
button after selecting a stepper arrowhead.
- If you change values faster than Data Explorer can generate images, it
will complete processing the current value and then "jump"
to the one most recently specified, passing over any
intermediate values.
- Click on the left-hand stepper arrow to decrease the value.
Again, new images appear in the Image window.
- Select End Execution in the
Execute pull-down menu.
Changing the interactor style
In this example, you will change the interactor style from
"stepper" (as in the preceding example) to "slider."
- Click on the scalar interactor Isosurface value
if it is not already highlighted.
- Click on Set Style in the
Edit pull-down menu of the
control panel.
Another pull-down menu appears.
- Click on Slider.
The interactor changes appearance.
- Select Execute On Change as in the
preceding example.
- Using the left mouse button, drag the slider tab to the right or
left to increase or decrease the isosurface value.
- Release the mouse button to generate an image corresponding to
the new value.
- Select End Execution in the
Execute pull-down menu.
Changing the interactor label
The default label of an interactor connected to a tool is the name
of the tool followed by the name of the input parameter:
in this case "Isosurface value."
- Click on the Isosurface value interactor if
it is not already highlighted with a white border.
- Click on Set Label... in the
Edit pull-down menu.
The Set Interactor Label... dialog box appears.
- Double click on the Interactor Label field or
drag the mouse cursor over the text.
- Type in a new name and click on OK.
The dialog box closes and the new interactor label appears in
place of the previous one.
Note: You may break the label into two or more lines by typing
\n where you want the desired line break(s)
to appear.
Creating Animations
This example demonstrates a few ways of using a sequencer.
- Open (but do not execute) visual program
.../Animate.net.
- Select Sequencer from the
Execute pull-down menu.
Note that both the Loop and Palindrome buttons in the control panel
are already activated (recessed).
- Click on the Forward button (>): the visual
program executes.
The Image window opens and the image begins to run continuously
through an "animation" sequence in which a data slice
changes position.
- Click on the Stop button (&sqbul;).
- Disconnect the leftmost AutoColor icon from
Image and connect the left output tab of the
other AutoColor icon to
Image.
- Click on the Forward button (>) again.
The animation sequence shows a set of streamlines growing longer and
then shorter and then repeating the process.
- Disconnect AutoColor from
Image and connect
Isosurface to
Image.
- Click on the Forward button (>).
The sequence is that of a continuously changing
isosurface.
- Click on the Stop button (&sqbul;) to halt the sequence.
See Sequencer in IBM Visualization Data Explorer User's Reference.
Note: In this example, a transmitter and several receivers are used
to make "invisible" connections between tools.
The frame tool below the Sequencer icon
is a transmitter.
The other frame tools are receivers.
Receivers and transmitters belong to the Special
category of tools (see IBM Visualization Data Explorer User's
Reference).
Changing the limits of the sequencer
- If the sequence is still running, click on the Stop button
(&sqbul;) to halt it.
- Click on the ellipsis button (...) in the
Sequence Control panel to open the
Frame Control dialog box.
- Click on the Max parameter field, type in
"30," and then press Enter.
- Click on the Forward button (>) to start the
sequence.
The isosurface sequence now proceeds to larger isovalues (smaller
isosurfaces).
- Close both control panels by double clicking on the top left
button of the Sequence Control box.
For Future
Reference |
---|
Min and Max control the
minimum
and maximum number of frames that a sequencer can generate.
Start and End are set by
default to the same values, but they can take any values in
the range.
The Increment parameter controls the difference
between output values (frames).
|
Creating and Using Macros
Macros are collections of tools that can be represented by a single
icon in the VPE canvas.
Macros thus allow you not only to simplify the appearance of your
visual program but also to share commonly used functions
between programs.
This section briefly introduces the basic concepts of creating and
using macros.
(The topic is treated in detail in IBM Visualization Data Explorer User's
Guide.)
The general procedure for creating a macro follows on the next page.
- Decide how many inputs and outputs your macro will have.
- For each input, select Special in the categories
palette
and then Input in the tools palette.
- Position the mouse cursor in the VPE canvas and click once to
generate an Input icon.
- Repeat Steps 2 and 3 for Output.
- Open the configuration dialog box for each tool to give it an
appropriate name, description, and default value.
- Select any additional tools you want to include in the macro and
place their icons on the canvas.
- Connect the Input and
Output icons to the
appropriate tools.
- Select Macro Name in the
Edit pull-down menu
and name the macro.
- Save the macro.
The following example illustrates the use of a macro in a visual program.
- Select Load Macro in the
File pull-down menu.
- Type /usr/local/dx/samples/tutorial/SampleMacro.net in the
Filter field at the top of the dialog box and
press Enter.
The name of the macro appears under Files on the
right side of the dialog box.
- Click on the macro name to highlight it, and then click on
Load Macro at the bottom of the
dialog box.
A new category appears in the categories palette:
Macros.
- Select the new category.
The name of the new macro appears in the tools palette.
Now you can open a visual program that uses this macro.
- Open and execute visual program
.../UseSampleMacro.net.
Although the visual program looks simple, the image it produces
is quite elaborate.
- Click on the SampleMacro icon to highlight it
and then select Open Selected Macro in the
Windows pull-down menu.
A new window appears, displaying the "network" of
SampleMacro:
This macro performs various operations on the output from three
Input modules (top) and feeds
the result to a single Output
module (bottom).
It is this output that is fed to the Display module
in the visual program.
Data-driven Tools
Many of the tools in Data Explorer can be "data driven".
That is, their attributes (e.g., limits) can be determined dynamically
at run time from the data set being used.
Note: The attributes of data-driven tools become effective only
after the first execution with the new data set.
Data-Driven Colormap Editor
- Open and execute visual program
.../DataDrivenColormap.net.
The image is a color-mapped slice of data, with a color bar at the top
of the Image window.
- Select Open All Control Panels in the
Windows pull-down menu and change the
Selector value to
wind.
- Reexecute the visual program.
The color map changes to reflect the new data set.
See Colormap in IBM Visualization Data Explorer User's Reference.
Data-Driven scalar interactor
Scalar, integer, and vector interactors can all be data driven.
The example here is that of a scalar interactor.
- Open and execute visual program .../DataDrivenScalar.net.
- Select Open All Control Panels in the Windows
pull-down menu and change Format value to
cloudwater.
- Leave the control panel open and reexecute the visual
program.
The Isosurface value (along with the image) is
updated to reflect the new data set.
See Scalar in IBM Visualization Data Explorer User's Reference.
Data-driven selector
In this example, the input from Import to the
Selector interactor is a data group
consisting of two fields.
- Open and execute visual program
.../DataDrivenSelector.net.
The image is a temperature field.
- Select Open All Control Panels in the
Windows pull-down menu.
- Select wind_velocity in the control panel
and reexecute the visual program.
The control-panel options temperature and
wind_velocity are derived from the
field names of the imported data.
In this network, Inquire determines whether or not
the data set is "vector" and, if so,
Include excludes
invalid data values.
If the data is not vector, the path followed goes directly from
Select to Switch.
See Selector in IBM Visualization Data Explorer User's Reference.
Data-driven sequencer
In this example, the limits for the Sequencer are
set automatically according to the number of elements in the
x-dimension of the data set (as determined
by the Inquire module).
- Open (but do not execute) visual program
.../DataDrivenSequencer.net.
- Select Sequencer from the
Execute pull-down menu.
Note that both the Loop and Palindrome buttons in the control panel are
already activated (recessed).
- Click on the Forward button (>): the visual program
executes.
The Image window opens and the image begins to run continuously through
an "animation" sequence of two dozen frames.
- Stop the animation sequence by:
- Clicking on the Stop (&sqbul;) or Pause (||)
button, or
- Clicking on the Loop and Palindrome buttons to deactivate them.
See Sequencer in IBM Visualization Data Explorer User's Reference.
Modules: Using AutoColor
The AutoColor module automatically colors data for you.
By default, it colors data from blue (for minimum values) to red
(for maximum values).
- Open and execute visual program
.../AutoColor.net.
The image is a translucent isosurface and a colored plane.
- Select Sequencer in the
Execute pull-down menu and
click on the Forward (>) button in the
Sequence Control panel.
The colors represent wind data.
- Click on the Stop button (&sqbul;) before proceeding.
Because AutoColor colors each plane individually,
the full blue-red range is used each time to represent the wind
variation in a single plane.
As a result, the same color in different planes can represent
different data values and different colors can represent
the same value.
In order to make the color representation consistent from plane to
plane:
- Connect the output tab of the rightmost Import
icon to the second (projecting) input tab of
AutoColor
("min").
- Click on the Forward button (>) of the Sequencer
again.
AutoColor now applies the blue-red range to the
entire data set, so that the same color values consistently
represent the same data values in every plane.
- Open the AutoColor configuration dialog box and
click on Expand to show the hidden parameters.
(See "Displaying and hiding parameters".)
- Click on the opacity toggle button and change
the value in the parameter field to ".3."
- Click on the Forward button (>) of the Sequencer again and
note the change in the plane.
See AutoColor in IBM Visualization Data Explorer User's Reference.
Modules: Using Compute
Compute is a general purpose module for performing
algebraic, trigonometric, and logical operations on data.
It can also extract components from vectors, create vectors
from scalar components, and cast between different data types.
- Open and execute visual program .../Compute.net.
The image represents wind velocity over the surface of the
earth.
Color values are based on the magnitude of the wind velocity, and
the small black squares and rectangles represent missing
data.
- Disconnect Include from
AutoColor and connect the
output of Compute to
AutoColor instead.
- Execute the visual program.
Now the colors are based on the absolute value of the x-component
of the wind velocity.
- Double click on the Compute icon to open the
configuration dialog box.
In this example the module has a single input (wind),
and the operation to be performed is to determine the
absolute value of its x-component.
- Change "abs(wind.x)" in the Expression
field to "abs(wind.y)." and reexecute the visual program.
The image changes accordingly.
Note: Compute is not limited to a single
input, and
input tabs can be added with the Add Input Tab
function in the Edit pull-down menu (see
"Adding Input Tabs to Tool Icons").
By default the inputs to Compute are labeled
a, b, c,..., but you can rename them.
It is also possible to use Compute on components
other than data.
For example, suppose you wanted to display a regular 2-D grid of
latitude and longitude on a spherical surface.
You could use Compute to convert the x,y positions
of latitude and longitude to x, y, and z positions of a
spherical surface.
For an example, open and execute visual program
.../WarpedGrid.net, which generates two entirely different
objects (in separate Image windows) from the same data.
See Compute in IBM Visualization Data Explorer User's Reference.
Modules: Using Map
The Map module maps one field of data onto
another.
The field to be mapped to is the first parameter; the field
to be mapped from, the second parameter.
In the most common use of this module, no other parameters are
set:
the positions of the first field are used as indices to the positions
of the second; the associated data values from the second field
are then mapped as new data values onto the first.
Components other than positions and
data can also be mapped to
one another.
- Open and execute visual program .../Map.net.
In this example, wind values are mapped onto an isosurface of
cloud-water quantity and the result is colored.
In addition, wind values are mapped onto a probe point and displayed as
text glyphs.
- Double click on the right-hand Import icon to
open its configuration dialog box.
The name parameter field contains a file name
ending in "wind".
- Change "wind" to "temperature" and click on
OK.
- Reexecute the visual program.
The image is now a color map of temperatures on the
isosurface.
The number displayed is the data value of the probe point.
- To move the probe point, first select
View Control in the
Options
pull-down menu.
- Next select Cursors in the
Mode pull-down menu.
The probe point appears as a small white square immediately to the left
of the data value.
- Drag the probe point to reposition it, and then release the
mouse button.
The data value is updated and displayed next to the newly positioned
probe point.
See Map and Probe in IBM Visualization Data Explorer User's
Reference.
Modules: Using Plot
Plot creates a 2-dimensional plot from x,y data.
(Data Explorer expects the "positions" component to contain the x-values,
and the data component the y-values.
You can pass (import) a group of such fields to Plot,
which plots them as multiple lines.
You can also add data-point markers to the lines.
- Open and execute visual program
.../Plot.net.
Two Image windows appear: one a color map of elevation data for the
southeastern United States; the other, a plot of the elevations
along the purple line shown in the color map.
(The Slab module extracts the elevation data along
the line, but Construct could have been used
to create the line and Map to map the
elevation data onto the line.
Note that Compute is used to extract only the
x-component of the positions.)
- To animate the line:
- Select Special and
Sequencer in the
palettes.
- Position the Sequencer icon above
Slab.
- Double click on the icon to open the
Sequence Control
panel and then single-click on the ellipsis button
(...) to open the
Frame Control
dialog box.
- Set Min to "0" and
Increment to "5."
- Click on the ellipsis button again to close the Frame
Control dialog box.
- Double click on Slab to open its configuration
dialog box.
- Click on the position toggle button to
deactivate it (the associated parameter field will read
"(all)") and then on OK.
- Connect the Sequencer output tab to the third
input tab of Slab ("position").
- Click on the Forward button (>) in the Sequence
Control panel.
- The limits of the plot change somewhat from frame to frame because
they are based on the line given for each frame.
To make the limits constant:
- Double click on the Plot icon to open its
configuration dialog box.
- Set the corners toggle button on and change the
values in the parameter field to
{[260, -6000][290, 2000]}.
- Click on Expand (to show the hidden parameters)
and then on the font toggle button (to change
the font to "roman_tser").
- Click on OK at the bottom of the dialog box.
- Click on the Forward button in the Sequence
Control panel.
- To place data-point markers on the data plot:
- Disconnect Plot from
Unmark.
- Connect the Options output tab to the
first
("input") tab of Plot.
- Reexecute the visual program.
The markers appear as small open circles.
- To see what options were specified, double click on the
Options icon to open its configuration
dialog box.
In this example, the "mark" attribute is set to "circle"
and the "mark every" attribute is set
to "10."
Thus every tenth data point is marked with a circle.
See Plot in IBM Visualization Data Explorer User's Reference.
Processing Images
A variety of image processing functions are available with the
Compute, Filter, and
Overlay modules.
A few of these functions are demonstrated in this example.
- Open visual program .../ImageProcessing.net.
- Select Open All Control Panels in the
Windows pull-down menu.
The control panel displays two selector interactors:
- The first specifies which of three filters is to be applied to
the data.
- The second specifies which of four image-processing functions
is to be performed.
(Note that only the first two of these functions is affected by the
options selected in the first interactor.)
- Select Execute on Change in the
Execute pull-down menu.
You can now select these different functions and observe their effects.
Saving and Printing Images
Once you have created an image, you can save it to a file or send
it to a printer.
(See also IBM Visualization Data Explorer User's Guide.)
- If your visual program uses the Image tool
(as the programs in this tutorial do), you can select
Save Image and Print
Image in the File
pull-down menu of the Image window.
When saving an image, you can choose among several formats and specify
the final image size or the resolution.
Similarly, you can choose format and size or resolution before printing
an image on your local printer (with a command such as:
lpr -Pmy_postscript_printer).
- If you are not using Image, you should use the WriteImage tool
(Import and Export category).
However, you will have to create the image with Render and display it
with Display (both are from the Rendering
category).
Connect the output of Render to the first input tab ("input") of
WriteImage.
Specify the format and size, using the parameters described under
WriteImage in IBM Visualization Data Explorer User's Reference.