Previous Getting Started with IDL: Images Next

Other Image Manipulations

Sections of images can be easily displayed by using subarrays.

  1. Erase the current display, create a new array that contains Manhattan and display it by entering:
  2. ERASE  
    E=MYIMAGE[100:300, 150:250]  
    

     

  3. Then enter:
  4. TV, E  
    

     

    Figure 6-16: Displaying a Section of an Image

    Figure 6-16: Displaying a Section of an Image

     

  5. Enter WDELETE at the Command Line to dismiss the graphics window.
  6. WDELETE  
    

Rotating an Image

Simple rotation in multiples of 90 degrees can be accomplished with the ROTATE function.

  1. Rotate the image by 90 degrees, as shown below, by entering:
  2. R=ROTATE(E,1)  
    

     

  3. Now enter to display:
  4. TVSCL, R  
    

     

    Figure 6-17: The Image Rotated by 90 Degrees

    Figure 6-17: The Image Rotated by 90 Degrees

     

    The second parameter of ROTATE is an integer from 1 to 8 that specifies which one of the eight possible combinations of rotation and axis reversal to use.

     

  5. Enter WDELETE at the Command Line to dismiss the graphics window for the next graphic.
  6. WDELETE  
    

  IDL Online Help (March 06, 2007)