The Raw File Read can be used to read raw 2D or 3D data defined on a regular rectilinear grid. The data can be in a single image file or a volume can be defined with multiple image files. Although this is technically a reader and should therefore be handle by Open Data, many parameters other than the file name are necessary for reading raw data. Grouping this reader with the other source object allows for a property sheet on which parameters can be specified. A file prefix and pattern are used to determine the names of the files in the series. The origin, extent, and spacing of the data must be specified along with the number of components. If the image file is bigger than expected from the extent and number of components, the extra bytes will be considered a header at the beginning of the file and will be skipped.
If a 2D image is specified using the extent, then the image will be mapped onto a plane and displayed. If a 3D image is specified, the bounding box of this volume will be displayed. The image plane or volume can be translated, rotated, and scaled using the Actor control area of the Display tab for this source, and it can be interactively positioned using the Move operation of the camera. The object created by this source is a vtkImageReader object, and the output of this reader is vtkImageData. . An example of a 2D image read using this raw file reader is given above.
The Raw File Reader has the following parameters:
File Prefix: Type the path and base file name of the file(s) you wish to read. You can also use the Browse button to locate a file. Be sure to remove any extension that will be added by the file prefix. For example, if you have a set of files image.1, image.2, image.3, etc located in /home/data, the File Prefix would be /home/data/image and the pattern would supply the .1, .2, .3, etc.
File Pattern: This is the pattern to use when creating the file names. By default this is set to %s.%d indicating that a "." and a number will be appended to the file name given by the File Prefix. The number will range across the Z extent of the data. If you specify the exact file name for a 2D data file in the File Prefix, you can change the File Pattern to %s to read that single file.
Data Type: The Data Type pulldown allows you to select from the following supported data types: char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, float, and double. This must be specified accurately for the read to succeed.
Byte Order: The byte ordering my be Little Endian or Big Endian. If this is specified incorrectly, the will likely appear quite "noisy".
Origin: The coordinate location of the origin of the image or volume can by specified here. The default value is (0,0,0) and it is fine to leave this default if you do not know the origin of your data.
Spacing: The spacing values indicate the world coordinate distance between sample points in the X, Y, and Z directions. The default values are all 1. If you do not specify the spacing correctly, the image you see may appear stretched or shrunk along an axis direction.
Extent: The six extent values indicate the minimum and maximum X index values, the minimum and maximum Y index values, and the minimum and maximum Z index values. If these values are X1, X2, Y1, Y2, Z1, Z2, then each image file is considered to be (X2-X1+1) by (Y2-Y1+1) elements (with X changing fastest) and there are (Z2-Z1+1) images with the %d value in the file pattern ranging from Z1 to Z2 (inclusive). The extent must be correctly specified for the read succeed, except that the Z extent can be reduced. For example, if you have a set of 100 images with names image.1, image.2, image.3, etc. you can specify a Z extent of 50, 50 to read in only the 50th image in the series.
Num Components: This entry box indicates the number of components per scalar value in the raw data. By default this value is 1. If you are loading I (intensity) data this value is 1, if you are loading IA (intensity alpha) data the number of components is 2. RGB data has 3 components, and if you are loading RGBA data this value would be 4.