note | If you have 64-bit PV-WAVE and need to read and write images up to 32-bits without constraints on data size, use the PHOTO OPI routines. |
note | If File_Type is TIFF16, all other keywords are ignored. |
note | Multiple images being read with the IMAGE_READ function must all be of the same height, width, and class. If a file contains images of different heights, widths, and/or classes, use the Sub_Img option to read a sub-image one at a time. |
BMP | MIFF | TGA | XWD |
DICM | PCD | TIFF | XPM |
GIF | PCX | TIFF16 | XBM |
JPEG | PNG | TIF | |
JPG | SUN | GEOTIFF |
note | The Img_Count keyword is ignored if the All_Subimages keyword is set. |
note | If Sub_Img is used to request a subimage that is not in the image file, the status key of the returned image associative array is set to a negative number. |
note | When you read a DICOM file with IMAGE_READ, PV-WAVE converts the hexadecimal DICOM tags to a human-readable format and stores them in a string array in the ’comments’ key with the format (####,####) Value. |
File type | Read/Write | Notes | ||
---|---|---|---|---|
BMP | RW | The BMP format currently supported for writing is version 4. | ||
DICM | RW | Uses Sub_Img option to read a sub-image one at a time. All_Subimages option is not supported. Files read with the .dcm extension will have the File_Type set to 'DICM'. | ||
GIF | RW | |||
JPEG JPG | RW | If your image associative array does not contain a colormap, the 2D image pixel array is preserved and a greyscale color map is added. | ||
MIFF | RW | |||
PCD | R | |||
PCX | RW | |||
PNG | RW | |||
SUN | RW | |||
TGA | RW | |||
TIFF TIF | RW | If the File_Type keyword is set to ‘TIFF16’, the pixels contained in the returned image associative array are LONGs instead of BYTEs. 16-bit TIFFs must have a PhotometricInterpretation tag value of 0 or 1 (MINISWHITE or MINISBLACK) to import properly. To display a 16-bit TIFF image, use TVSCL, image(‘pixels’), not IMAGE_DISPLAY. If the PhotometricInterpretation tag value is 1 and the image is displayed reversed, use the following statement to correct the pixel array: image('pixels') = ROTATE(image('pixels') , 7) | ||
GEOTIFF | R | |||
XWD | RW | Not supported on Windows. | ||
XPM | R | Not supported on Windows. Converted to 24-bit direct color on read/write. (NOTE: In order to read an XPM file, the DISPLAY environment variable must be set.) | ||
XBM | R | Reduces the image to monochrome (black and white) on write. |
note | File type TGA does not have an encoded ID number. To read this type of file you must specify the File_type keyword or filename must have a .tga suffix. |
; Reads the file veggies.jpg and returns the
; image associative array.
veggies = IMAGE_READ(!Dir + '/demo/gallery3/data/veggies.jpg')
; This example shows how to read a TGA image file which has been
; saved as 'usa_map.tga.txt'. Since the filename extension does
; not reflect the correct image type the File_Type keyword is
; required to specify that this is a TGA file.
imagefile = !Data_Dir + '/usa_map.tga.txt'
usa_map = IMAGE_READ(imagefile, File_Type='TGA')