User Tools

Site Tools


CIGAL Reference Manual, Chapter 2 (Commands): READ

READ -- Read data from a disk file into a CIGAL variable

usage: read file [ varb flag recsize hdrbytes wordsize ]

READ is used to read binary data from a disk file into a CIGAL variable. This command reads data a block at a time with no format conversion. The FILE argument specifies which disk file is to be read, and the VARB argument indicates where the data are stored. The READ command transfers enough records to fill VARB, or until the end of the disk file.

The arguments to READ are:


The file argument is required. FILE can either be a character string giving the name of the disk file explicitly, or it can be a number in which case the file name is generated by appending that number to the character string in the DATADIR internal variable (see DATADIR(4)). An error message will appear if READ cannot find a disk file with the specified name. See FILES(1) for more general information on accessing disk files from CIGAL.


The target variable can be any ARRAY, MATRIX, IMAGE, or SOLID variable, or a subset of any of these variables (see VARIABLES(1) and SUBSCRIPTS(1)). If you are using an image processor, then VARB can also be a number in which case it is assumed to refer to one of the numbered image memory planes within the image processor hardware (see IMAGING(1) and DEVICES(1)).

If the target variable is not specified, the READ command will assume the current display image. If you have an image processor and it has been initialized, then the current display image is the active memory of the image processor (see IPLANE(4)). Otherwise, the current display image is the terminal's video screen if you are in graphics mode, or null if you are in text mode (see GRAPHICS(1)).


Normally, READ's format is taken from the header block of the data file. This can be overridden with the FLAG argument, as:

             FLAG = 1-7   Read data in "packed" format (see [WRITE][2]).
                    70o   File format:
                       10o   Short CIGAL modified TIFF format (default)
                       20o   Standard TIFF format
                       30o   BITMAP format
                       40o   PICT format (not implemented yet)
                       70o   Pitt fMRI format
                   100o   Don't treat first block as header block
                   200o   Reverse byte order (e.g. for TIFF files)


The number of 8-bit bytes to be transferred in each I/O record. The default record size is 4096 bytes. This argument is ignored if the target VARB already has a record size set (see POINTER(3)).


The number of bytes to skip at the beginning of the disk file. Default is 0.


The number of bytes per word in the disk file. Default is 1.

See Also:

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/read.txt · Last modified: 2024/06/21 15:44 by