ION Script source code:




<!-- Copyright (c) 1997-2002, Research Systems, Inc.  All rights reserved
     Unauthorized reproduction prohibited. -->

<ION_SCRIPT>
<ION_HEADER>
   <TITLE>Image Data</TITLE>
</ION_HEADER>

<ION_BODY>

  <FONT SIZE="+2">Image Data</FONT>
  <BR>
  <ION_DATA_OUT>
    <IDL>
      ; Read in the original image:
      image = read_png( filepath(sub=['products','ion','ion_script','examples', 'data'], 'landsat.png'), r, g, b)

      ; Calculate the x subscripts:
      xstart = $CENTER_X - $REGION_W/2
      xend = $CENTER_X + $REGION_W/2 - 1

      ; Calculate the y subscripts:
      ystart = $CENTER_Y - $REGION_H/2
      yend = $CENTER_Y + $REGION_H/2 - 1

      ; Create the region to be displayed:
      region = image[xstart:xend, ystart:yend]

      ; Print min, max, and mean:
      print, '<B>Minimum Value:</B>', min(region)
      print, '<B>Maximum Value:</B>', max(region)
      print, '<B>Mean Value:</B>', mean(region)
    </IDL>
  </ION_DATA_OUT>

</ION_BODY>
</ION_SCRIPT>