Read4DLayer

Declaration: Read4DLayer(FName: string; Layer, TSlot: integer; var Data: TDouble2DArray): integer;
The function Read4DLayer reads all data values of the layer specified by the parameters Layer and TSlot of the file FName. The read data are stored in the two-dimensional array Data. The Data array is automatically resized to fit the size of read layer.

The function returns the following error codes:

 0 ... everything is OK
-1 ... TSlot is out of range
-2 ... Layer is out of range
-3 ... file FName cannot be accessed

Hint 1: The file specified by FName must comply with the binary file format used by TMat4D.SaveBinary, otherwise the routine may result in access violations or otherwise misleading results.

Hint 2: Please note that this routine accesses the binary data cube directly, thus the filename must contain the full path of the corresponding '.cube' file (and not the '.ilab' file, as it would be the case for normal access).