# coyote: CONTRASTZOOM

- coyote/Widget Programming
- coyote/Graphics
- [Source code]

NAME

      CONTRASTZOOM

PURPOSE

      The purpose of this program is to demonstrate how to
      zoom an image "in place" and how to window and level
      (set "contrast and brightness") an image using object
      graphics functionality. The exercise involves using
      multiple views in an object graphics scene, and being
      able to interact with different views in different ways.

AUTHOR

      FANNING SOFTWARE CONSULTING
      David Fanning, Ph.D.
      1645 Sheely Drive
      Fort Collins, CO 80526 USA
      Phone: 970-221-0438
      E-mail: david@idlcoyote.com
      Coyote's Guide to IDL Programming: http://www.idlcoyote.com

CATEGORY

      Widgets, Object Graphics.

CALLING SEQUENCE

      ContrastZoom, image

REQUIRED INPUTS

      None. The image "mr_knee.dcm" from the examples/data directory
      is used if no data is supplied in call.

OPTIONAL INPUTS

      image: A 2D image array of any data type.

OPTIONAL KEYWORD PARAMETERS

      COLORTABLE: The number of a color table to use as the image palette.
      Color table 0 (grayscale) is used as a default.
      GROUP_LEADER: The group leader for this program. When the group leader
      is destroyed, this program will be destroyed.

COMMON BLOCKS

      None.

SIDE EFFECTS

      None.

RESTRICTIONS

      None. The Coyote Library program VCOLORBAR is included.

EXAMPLE

      To use this program with your 8-bit image data and a red-temperature
      color scale, type:
         IDL> ContrastZoom, image, Colortable=3

NOTES

      The left image is used to "zoom" into a portion of the image.
      The aspect ratio of the sub-image is always preserved. To see
      the entire image, click and release the mouse button in this
      window.
      The center image is used to adjust the contrast and brightness
      (sometimes called the "window" and "level" of the image. Click and
      drag the mouse vertically to set contrast. Click and drag the mouse
      horizontally to set brightness. To return to original values (25%
      contrast and 75% brightness), click and release in the center image.
      The color bars shows the image values of the image.

MODIFICATION HISTORY

      Written by David Fanning, 18 November 2001.
      Added second colorbar to show the relationship of the clamped
         colors to the overall image values. 19 November 2001. DWF.
      Changed FSC_Normalize to cgNormalize to reflect new name. 6 Feb 2013. DWF.