Previous Getting Started with IDL: Images Next

Image Data and the Command Line

The following sections show examples of reading and displaying image data at the command line.

Reading Image Data

First we must import an image to be processed into IDL. Reading image data files into IDL is easy whether at the command line or using the iImage tool.

The file that we will read contains the image we used in Reading and Writing Data of an aerial view above Manhattan in TIFF format.

  1. Read the file by entering:
  2. MYIMAGE=READ_TIFF(FILEPATH('image.tif',SUBDIR= $
       ['examples', 'data']))  
    

Displaying Image Data

Using the IDL command line, you can view an image with two different routines. The TV procedure writes an array to the display as an image without scaling. Enter the commands below at the IDL Command Line. The TVSCL routine is another routine which is described following the TV routine.


Note
The default graphics window size is 640 by 512 pixels in size on a UNIX workstation and one-fourth of the display size on most Windows environments.

  1. Display the image:
  2. TV, MYIMAGE  
    

     

    Figure 6-2: Displaying an image with TV

    Figure 6-2: Displaying an image with TV

     

  3. Enter WDELETE at the Command Line to dismiss the graphics window.
  4. WDELETE  
    

     

  5. The TVSCL procedure displays the image with the color values scaled to use the whole color table. Display the scaled image:
  6. TVSCL, MYIMAGE  
    

     

    Figure 6-3: Displaying an image with TVSCL

    Figure 6-3: Displaying an image with TVSCL

     

  7. Enter WDELETE at the Command Line to dismiss the graphics window.
  8. WDELETE  
    

  IDL Online Help (March 06, 2007)