• saoMaskDisplay
  • saoMaskColorSet
  • saoMaskGlyphSet
  • tclSaoMaskDisplay.c

    ABSTRACT:
    
    This file contains the routines used to display a mask on FSAO through TCL.
    
      

    Generating the Colors

    A user supplied TCL script or procedure is used to translate the mask values to color values. Eight color values (plus transparent) are allowed. Thus the 256 possible mask values (0 - 255) must be mapped onto 9 values (0 - 8). The colors specified in the saoMaskColor Set command map directly onto values 1 - 8. Value 0 is always configured to be transparent. The function of the user supplied TCL script or procedure is to take as input a single mask value (0 - 255) and return a single color value 0 - 8). In this manner the meaning of the mask is interpreted in a user defined way. These generated color values are used to display the mask in FSAO. The user supplied TCL procedure must take the mask value as it's last argument and return the color value. The user supplied TCL script must use the variable 'maskVal' to mean the mask value. For example, if the following commands were entered (This is after a region and accompanying mask have been generated.) - dervish>saoMaskColorSet {red yellow red green blue blue yellow green} dervish>saoMaskDisplay h0 -t {expr {($maskVal&1) ? 1 : 0}} This script would result in only the colors red (corresponding to 1) or transparent being displayed. All mask values that had the low bit set would appear as red and all others would not be masked.

    Or when using a TCL procedure -

    dervish>saoMaskColorSet {red yellow red green blue blue yellow green} dervish>saoMaskDisplay h0 -p myProcedure

    saoMaskDisplay

    DESCRIPTION:
    
    The saoMaskDisplay command will display the specified mask, using FSAOimage. The following must be true before attempting to display a mask -
  • A copy of FSAOimage must be running.
  • The command saoMaskColorSet must have been executed.
  • The specified mask must be the same size as the region currently being displayed.
  • After issuing the saoMaskDisplay command the masked region is displayed immediately. Clicking on the right mouse button (on a right handed mouse) will toggle between displaying the masked region and the unmasked region. FSAO must be in SCALE mode for this to work. NOTE: this means the right mouse button cannot be used for blinking.

    The values of BOTTOMCOLOR and TOPCOLOR are defined in imtool.h.

    See also Generating the mask colors.

    SYNTAX:
      saoMaskDisplay  <name> [-t TCL script | -p TCL procedure] [-s FSAO #]
      	<name>          Name of mask to display.
    
    	[-t TCL script | -p TCL procedure]
    			Optional TCL script or procedure used to
                          translate the mask values into color values for
                          display. The default is to assume that the mask
                          associated with the region already specifies the
                          color values.  These values must be between 1 and 8.
                          For an example of the TCL script see the top of this
                          page.  The TCL procedure can be any user written 
                          procedure that takes as a parameter an index into the
                          mask and returns the value of the mask which must be
                          between BOTTOMCOLOR and TOPCOLOR.
    	[-s FSAO #]     Optional FSAOimage program to display mask in.  The
    			default is to draw the glyph in the lowest
                          numbered FSAOimage program belonging to the current
                          DERVISH process.
    

    saoMaskColorSet

    DESCRIPTION:
    
    The saoMaskColorSet command allows the user to specify the colors to be used when displaying the mask in FSAO. The color names should be those recognized by X (e.g. RED, BLUE, GREEN...) and are not case sensitive. It should be noted that X color names may differ from machine to machine. An exact color match is not guaranteed. An attempt will be made to get the closest available color to the requested color. The specified colors will be used to display all masks until this command is entered with new color values.

    Eight colors (plus transparent) can be used to display a mask. By default, the mask color on a monochrome display is white.

    SYNTAX:
      saoMaskColorSet  <tclColorList>
    	<tclColorList>  TCL list of colors to be used when displaying a
    			mask.  Must contain 8 color values.  For example,
    			{RED BLUE GREEN YELLOW RED BLUE GREEN YELLOW}
    

    saoMaskGlyphSet

    DESCRIPTION:
    
    The saoMaskGlyphSet command allows the user to specify the glyph to be used when displaying the mask in FSAO. The glyph is displayed when the image is magnified larger than lifesize. The possible glyphs are "x" or "box". saoMaskGlyphSet can be called only after FSAO is started with saoMaskDisplay and applies only to that particular FSAOimage. By default, FSAO uses the "x" glyph.
    SYNTAX:
      saoMaskGlyphSet  <glyph> [-s FSAO #]
    	<glyph>         The glyph name -- either X or BOX.
    
    	[-s FSAO #]     Optional FSAOimage program to display mask in.  The
    			default is to draw the glyph in the lowest
                          numbered FSAOimage program belonging to the current
                          DERVISH process.