If/Else Construct Example
Want to accomplish the following:
- if variable "i" is greater than zero ( i>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 If/Else construct
- Create an If/Else glyph.
- Use the "Variables" subform to define and initialize a boolean variable
to be used in the conditional expression of the If/Else operator.
NOTE: every time you change the value of a variable, reset your
workspace environment before a new execution of your visual program.
- Open the pane of the If/Else operator and type in the condition.
- Close the pane and connect the If/Else glyph in your visual program.

If/Else pane

Variables pane
Building the Cantata Workspace
- Get image gull.viff using the and display it using operators
User defined operator.
- Select the If Else operator.
- 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 if-else.wk
DIP Feedback Form