ISIS Documentation

stretch

Remaps pixel values in a cube

This program stretchs or remaps pixels values in a cube. Note that the same stretch is applied to all bands within the cube. The underlying method for remapping pixels is defined by a set of stretch pairs and is best described using an example:
      0:0
      255:1
    
A stretch pair is two numbers separated by a colon. In this case, 0:0 and 255:1 comprise two stretch pairs. A pair is used to identify the mapping of input pixels to output pixels where the colon is a delimiter (i.e., input:output). Our first pair indicates input pixel values of 0 will be mapped to an output 0, while the second pair indicates input pixel values of 255 will be mapped to 1. All inputs between 0 and 255 will be mapped linearly (e.g., 127.5 will be mapped to 0.5). Therefore, the output cube will only have pixel values between 0 and 1. Those input pixels below 0 will be mapped to LRS and above 255 to HRS. This mapping to special pixels can be overridden. Because multiple pairs are allowed, many different types of remappings can be accomplished. For example:
      Inverse Stretch
      0:255
      255:0

      Piece-wise Linear Stretch
      20:0.0
      50:0.5
      125:1.0

      Saw-tooth Stretch
      0:0.0
      50:1.0
      100:0.0
      200:1.0

      Binary stretch
      0:0.0
      49.9999:0.0
      50:1.0.0
      79.9999:1.0
      80:0.0
      255:0.0
    
If you are having difficulty visualizing these stretches simply plot the input:output pairs on graph paper and connect the dots or see some of the examples. Note that the input value of each pair is in ascending order. As a reminder, all input pixel values less than the input value for the first pair are mapped to LRS. Likewise, all pixel values greater than the input value for the last pair are mapped to HRS.

Categories


Related Objects and Documents

Applications


History

Jim Torson1990-11-17 Original version
Jeff Anderson2002-09-17 Ported to Isis 3.0
K Teal Thompson2002-12-03 Add examples
K Teal Thompson2003-04-04 Make images smaller. Adjust binary stretch example.
Kim Sides2003-05-13 Added application test
Stuart Sides2003-05-16 Modified schema location from astogeology... to isis.astrogeology..."
Stuart Sides2003-05-30 Made changes to application test truth files to reflect -O1 optimization
Stuart Sides2003-07-29 Modified filename parameters to be cube parameters where necessary
Brendan George2006-06-30 Fixed application test
Jeannie Walldren2008-01-09 Modified stretch parameters (except PAIRS) to accept string instead of double so that special pixels may be set to other special pixel values.
Eric Hyer2009-04-30 Users can pass a file containing stretch pairs as well as inputing them manually as before. Also, the input side of stretch pairs can optionally be percentages instead of dn values.
Eric Hyer2010-04-23 Added support for stretch files not ending in a newline. Also did some code refactoring to eliminate duplicate code.