EXAMPLE: CONTOUR.CMD


Contents Summary

Detailed Contents
1. Introduction
2. Starting DigImage
3. Basic Operation
4. Sample Session
5. Command Files
6. Movies
7. Coordinate Systems
8. Warnings, Errors and Crashes
9. Utilities
10. Macros
11. Other Considerations
12. Updates
Appendix A: Menus
Index


5.6 EXAMPLE: CONTOUR.CMD

Before we show how to call these routines from other command files, we shall write a routine to contour a series of buffers into a single one.

################################################################
# Contour.CMD                                                  #
#   Command sequence for contouring a series of buffers at a   #
#   specific contour level.                                    #
#                                                              #
#   Passed:                                                    #
#       !!1 First buffer to be contoured                       #
#       !!2 Last buffer to be contoured                        #
#       !!3 Buffer to place contours in. Note that this        #
#           should be erase first, if desired.                 #
#       !!4 Intensity of contour                               #
#       !!5 Minimum contour length                             #
#       !!6 Length to smooth contours over                     #
#   Local:                                                     #
#       !!0 Used to store contour plot intensity               #
################################################################
# Start from main menu
; Return to main menu
# If this command file is nested, then assume !!1, !!2 and !!3
# contain required values, otherwise prompt user for buffer range
!!L>0 :RangeSpecified
  !^ First buffer to be contoured ?
  !!1:=!!B
  !^ Last buffer to be contoured ?
  !!2:=!!B
  !^ Place contours in which buffer ?
  !!3:=!!B
  !^ Contour which intensity
  !!4:=!!K
  !^ Minimum contour length (shorter contours will not be plotted) 

  !!5:=!!K
  !^ Smooth contours over what length ?
  !!6:=!!K
!!:RangeSpecified

# Enter Contours menu. There may be a delay while DigImage changes
# program modules.
C: Contours and Edges

# Initialise plot intensity
!!0:=255
!!:NextSourceBuffer

  # Contour each buffer in turn, using the current default window 
  C  Contours
  !!1            # Find contours on buffer
  !!3            # Plot on buffer
  Window for contours
  Grab window
  !!4            # Contour threshold intensity
  !!0            # Contour plot intensity
  !!5            # Minimum contour length
  !!6            # Length to smooth contours over

  # Increment counters etc. and check for end of loop
  !!1:=!!1 + 1   # Next source buffer
  !!0:=!!0 - 8   # Next plot intensity
!!1<=!!2 :NextSourceBuffer

; Return to main menu


Goto next document (DyeCont)


Links

SYSTEM OVERVIEW

Contents
Index

OTHER

DigImage documentation page
DigImage home page
Stuart Dalziel's home page


Stuart Dalziel, last page update: 21 June 1999