Previous PageNext Page

4. File formats

4.1. Image files

WinDisp3 uses images in the IDA (Image Display and Analysis) format. The IDA image file consists of a 512 byte image header followed by unblocked (raw binary) image data, 1 byte per pixel, beginning at the top-left of the image and processing row by row. This means that the size of an IDA image in bytes can be expressed as 512 + (lines*pixels).

An image that is 150 lines high and 234 pixels wide will have an image size of 35612 bytes. This provides an excellent check whenever images seem to be distorted. Some caution however is justified. A number of systems that generate IDA images leave some extra bytes at the end of an image. They do not influence the image display, but the image size does not adhere to the above mentioned formula.

4.1.1. Image header format

BYTE

CONTENTS

DATA TYPE

1-22

(reserved)

 

23

image type

character

24

projection

character

25-30

(reserved)

 

31-32

height

integer (2 bits)

33-34

width

integer (2 bits)

35-38

(reserved)

 

39-118

title

80 characters

119-120

(reserved)

 

121-126

lat_center

real 6 bits

127-132

long_center

real 6 bits

133-138

x_center

real 6 bits

139-144

y_centre

real 6 bits

145-150

dx

real 6 bits

151-156

dy

real 6 bits

157-162

parallel 1

real 6 bits

163-168

parallel 2

real 6 bits

169

lower limit

character

170

upper limit

character

171

missing value

character

172-177

slope (m)

real 6 bits

178-183

intercept (b)

real 6 bits

184

decimals

character

185-512

(reserved)

 

The image values themselves are stored as bytes in the rest of the image file. The first byte of this block (offset 513) is the top-left most pixel of the image, followed by the rest of the first line. Line for line is then specified. The last byte represents the pixel value for the bottom-right most pixel in the image.

The following is the TURBO-PASCAL record type description for the image header record:

4.1.2. Description of the image header items

height, width

These values define the number of pixels across and down the image. An image will not display properly without these parameters. Maximum value for either parameter is 32767.

title

The header reserves 80 characters for a description of the contents of the image. This is an optional feature.

reserved

All reserved slots are to maintain compatibility with the TERRAMAR MICROIMAGE file format. Programmers can use these zones to store information, when no compatibility with TERRAMAR is required.

image_type

The image type is used when converting pixel counts into true values for NDVI. The image type also tells which pixel counts are for cloud masks, overlays, garbage, etc.

The following image types are defined:

This is always a linear relationship that can be expressed by:

value = slope * byte value + intercept, by analogy with the basis formula : y = mx + b.

For normal image processing, GENERIC is suggested.

projection
The projection information is used when overlaying maps on images, reprojecting images, and getting lat/long image co-ordinates with the cursor.

The following projections are implemented:

The values lat_center, long_center, x_center, y_center, dx, dy, parallel1 and parallel2 determine for a given image type the pixel size, the exact location on earth and the 'shape' of the image. To be more precise:

lat_center, long_center

These values identify the center of the projection in decimal degrees.

x_center, y_center

These values define the center of the image relative to the reference projection image. For the reference image, these values are 1/2 the height and width. For sub-images, the sub-image offsets are subtracted from the reference x_center, y_center.

dx, dy

These values are used by the projection routines.

parallel1, parallel2

The standard parallels are used by the Lambert Conformal Conic projection, and Albers Equal-Area Conic.

lower

The lower limit for valid image data to be used in processing (range = 0-255). Only available for image type 200.

upper

The upper limit for valid image data to be used in processing (range = 0-255). Only available for image type 200.

missing

Value to assign to all values falling outside the lower, upper limits (range = 0-255). Only available for image type 200.

m

Slope for converting pixel counts to real-world values (y = mx + b). Only available for image type 200.

b

Intercept for converting pixel counts to real-world values (y = mx + b). Only available for image type 200.

decimal

The number of decimal places to use in Process Stats. Only available for image type 200.

Remark
For further information, please refer to the user manual `IDA for DOS v.4.2 - Image display and analysis', FAO 1996 (SD:GCP/INT/578/NET Technical report).


Previous PageTop Of PageNext Page
This manual was prepared by the Global Information and Early Warning System of the United Nations Food and Agriculture Organization
© FAO/GIEWS - 1999
E-mail: Giews1@fao.org