If/Else Construct Example

Want to accomplish the following:

To use the If/Else construct

  1. Create an If/Else glyph.
  2. 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.
  3. Open the pane of the If/Else operator and type in the condition.
  4. Close the pane and connect the If/Else glyph in your visual program.


If/Else pane


Variables pane


Building the Cantata Workspace

  1. Get image gull.viff using the and display it using operators User defined operator.
  2. Select the If Else operator.
  3. Use the "TRUE" path to display the image and its pseudo color palette. Use the operators Display Image and Display Palette.
  4. 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

Copyright © 1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved.