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:

To use the Expression construct

  1. Create an Expression glyph.
  2. 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.
  3. Close the pane and connect the Expression glyph in your visual program.


Variables pane


If/Else pane


Building the Cantata Workspace

  1. Get image gull.viff using the and display it using operators User defined operator.
  2. Select the Expression and If Else operators.
  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 expr-if-else.wk
DIP Feedback Form

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