**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: __**FILE**__ 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 [[jvs:cigal:manual:chapter4:datadir|DATADIR(4)]]). An error message will appear if READ cannot find a disk file with the specified name. See [[biac:jvs:cigal:manual:chapter1:files|FILES(1)]] for more general information on accessing disk files from CIGAL. __**VARB**__ The target variable can be any ARRAY, MATRIX, IMAGE, or SOLID variable, or a subset of any of these variables (see [[jvs:cigal:manual:chapter1:variables|VARIABLES(1)]] and [[biac:jvs:cigal:manual:chapter1:subscripts|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 [[biac:jvs:cigal:manual:chapter1:imaging|IMAGING(1)]] and [[biac:jvs:cigal:manual:chapter1:devices|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 [[jvs:cigal:manual:chapter4:iplane|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 [[biac:jvs:cigal:manual:chapter1:graphics|GRAPHICS(1)]]). __**FLAG**__ 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) __**RECSIZE**__ 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 [[jvs:cigal:manual:chapter3:pointer|POINTER(3)]]). __**HDRBYTES**__ The number of bytes to skip at the beginning of the disk file. Default is 0. __**WORDSIZE**__ The number of bytes per word in the disk file. Default is 1. **See Also:**\\ [[jvs:cigal:manual:chapter4:datadir|DATADIR(4)]], [[jvs:cigal:manual:chapter1:devices|DEVICES(1)]], [[jvs:cigal:manual:chapter1:files|FILES(1)]], [[jvs:cigal:manual:chapter1:graphics|GRAPHICS(1)]], [[jvs:cigal:manual:chapter1:imaging|IMAGING(1)]], [[jvs:cigal:manual:chapter2:input|INPUT(2)]], [[jvs:cigal:manual:chapter4:iplane|IPLANE(4)]], [[jvs:cigal:manual:chapter2:output|OUTPUT(2)]], [[jvs:cigal:manual:chapter3:pointer|POINTER(3)]], [[jvs:cigal:manual:chapter1:subscripts|SUBSCRIPTS(1)]], [[jvs:cigal:manual:chapter1:variables|VARIABLES(1)]], [[jvs:cigal:manual:chapter2:write|WRITE(2)]] [[jvs:cigal|CIGAL Home]], [[jvs:cigal:manual|CIGAL Manual]], [[jvs:cigal:manual:chapter2|Commands List]], [[jvs:cigal:manual:help|Manual Help]]