Expression Construct Example
In this example we will use the Expression construct to modify
the value of the variable being used with the If/Else construct.
Want to accomplish the following:
- if variable "i" is even [(i%2)==0] then display an image
(gull.viff) and its pseudo color palette.

Original image

Pseudo Color Palette
- else, pseudocolor the image and display the result.

Pseudo Colored Image

Autocolor Options
To use the Expression construct
- Create an Expression glyph.
- Open the pane of the Expression operator and type in the expression
that is to be used to define, initialize, or modify the value of a variable.
- Close the pane and connect the Expression glyph in your visual program.

Variables pane

If/Else pane
Building the Cantata Workspace
- Get image gull.viff using the and display it using operators
User defined operator.
- Select the Expression
and If Else operators.
- Use the "TRUE" path to display the image and its pseudo
color palette. Use the operators
Display Image and
Display Palette.
- Use the "FALSE" path to pseudocolor the image and display it.
Use the operators Autocolor
and Display Image.
Execute the visual program expr-if-else.wk
DIP Feedback Form