# coyote: CGCLIPSCL

- coyote/Image Processing
- [Source code]

Description

      This is a utility routine to perform linear scaling (similar to BYTSCL)
      on image arrays. If differs from BYTSCL only in that a user-specified
      percentage of pixels can be clipped from the image histogram, prior to
      scaling. By default, two percent of the pixels are clipped. Clipping
      occurs at both ends of the image histogram.

Categories

      Image Processing

Returns

      A byte scaled image is returned.

Params

      image: in, required
         The image to be scaled. Written for 2D images, but arrays of any size are treated alike.
      clip: in, optional, type=float, default=2.0
          The percent of image clipping. Must be value between 0 and 49. Clipping
          occurs from both ends of image histogram, so a clip of 2.0 linearly scales
          approximately 96% of the image histogram. Clipping percents are approximations
          only, and depend entirely on the distribution of pixels in the image. For
          interactive scaling, see cgStretch.

Keywords

      negative, in, optional, type=boolean, default=0
           If set, the "negative" of the result is returned.
      omax: in, optional, type=byte, default=255
           The output image is scaled between OMIN and OMAX.
      omin: in, optional, type=byte, default=0
           The output image is scaled between OMIN and OMAX.
      threshold: out, optional
          A two-element array containing the image thresholds that were used for the clipping.

Examples

      To display a clipped image::
         cgLoadCT, 0                                            ; Gray-scale colors.
         image = cgDemoData(22)                                 ; Load image.
         cgImage, cgClipScl(image, 4)

Author

      FANNING SOFTWARE CONSULTING::
          David W. Fanning
          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

History

      Change History::
        Written by:  David W. Fanning, 6 September 2007.
        Not sure what this program was doing, but not what I thought. I've reworked
           the algorithm to scale the data appropriately. 25 Oct 2011. DWF.
        Renamed cgClipScl from ClipScl. 27 March 2015. DWF.

Copyright

      Copyright (c) 2007-2015, Fanning Software Consulting, Inc.