Documentation for vtkImageReader

vtkImageReader - Superclass of binary file readers.

Super Class: vtkImageSource

Description:

vtkImageReader provides methods needed to read a region from a file.

 

See Also:

vtkBMPReader vtkPNMReader vtkTIFFReader

 

Methods:

void vtkImageReader ()
void vtkImageReader ()
static vtkImageReader *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
void SetFileName (char *)
char *GetFileName ()
void SetFilePrefix (char *)
char *GetFilePrefix ()
void SetFilePattern (char *)
char *GetFilePattern ()
void SetDataScalarType (int )
void SetDataScalarTypeToFloat ()
void SetDataScalarTypeToInt ()
void SetDataScalarTypeToShort ()
void SetDataScalarTypeToUnsignedShort ()
void SetDataScalarTypeToUnsignedChar ()
int GetDataScalarType ()
void SetNumberOfScalarComponents (int )
int GetNumberOfScalarComponents ()
void SetDataExtent (int ,int ,int ,int ,int ,int )
void SetDataExtent (int *)
int *GetDataExtent ()
void SetDataVOI (int ,int ,int ,int ,int ,int )
void SetDataVOI (int *)
int *GetDataVOI ()
void SetFileDimensionality (int )
int GetFileDimensionality ()
void SetDataSpacing (float ,float ,float )
void SetDataSpacing (float *)
float *GetDataSpacing ()
void SetDataOrigin (float ,float ,float )
void SetDataOrigin (float *)
float *GetDataOrigin ()
vtkImageCache *GetOutput ()
void UpdateImageInformation ()
int GetHeaderSize ()
int GetHeaderSize (int )
void SetHeaderSize (int )
unsigned short GetDataMask ()
void SetDataMask (int )
void SetTransform (vtkTransform *)
vtkTransform *GetTransform ()
void SetDataByteOrderToBigEndian ()
void SetDataByteOrderToLittleEndian ()
int GetDataByteOrder ()
void SetDataByteOrder (int )
char *GetDataByteOrderAsString ()
void SetSwapBytes (int )
int GetSwapBytes ()
void SwapBytesOn ()
void SwapBytesOff ()
void ComputeInverseTransformedExtent (int ,int )
void ComputeInverseTransformedIncrements (int ,int )
void OpenFile ()
void OpenAndSeekFile (int ,int )
void FileLowerLeftOn ()
void FileLowerLeftOff ()
int GetFileLowerLeft ()
void SetFileLowerLeft (int )
void ComputeInternalFileName (int )
char *GetInternalFileName ()
void ComputeTransformedSpacing (float )
void ComputeTransformedOrigin (float )
void ComputeTransformedExtent (int ,int )
void ComputeTransformedIncrements (int ,int )
void Execute (vtkImageData *)
void ComputeDataIncrements ()

 

Detailed Method Descriptions:

Specify file name for the image file. You should specify either a FileName or a FilePrefix. Use FilePrefix if the data is stored in multiple files.

void SetFileName (char *)
char *GetFileName ()

Specify file prefix for the image file(s).You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

void SetFilePrefix (char *)
char *GetFilePrefix ()

The sprintf format used to build filename from FilePrefix and number.

void SetFilePattern (char *)
char *GetFilePattern ()

Set the data type of pixles in the file. As a convienience, the OutputScalarType is set to the same value. If you want the output scalar type to have a different value, set it after this method is called.

void SetDataScalarType (int )
void SetDataScalarTypeToFloat ()
void SetDataScalarTypeToInt ()
void SetDataScalarTypeToShort ()
void SetDataScalarTypeToUnsignedShort ()

Get the file format. Pixels are this type in the file.

void SetDataScalarTypeToUnsignedChar ()
int GetDataScalarType ()

Set/Get the number of scalar components

void SetNumberOfScalarComponents (int )
int GetNumberOfScalarComponents ()

Get/Set the extent of the data on disk.

void SetDataExtent (int ,int ,int ,int ,int ,int )
void SetDataExtent (int *)
int *GetDataExtent ()

Set/get the data VOI. You can limit the reader to only read a subset of the data.

void SetDataVOI (int ,int ,int ,int ,int ,int )
void SetDataVOI (int *)
int *GetDataVOI ()

The number of dimensions stored in a file. This defaults to two.

void SetFileDimensionality (int )
int GetFileDimensionality ()

Set/Get the spacing of the data in the file.

void SetDataSpacing (float ,float ,float )
void SetDataSpacing (float *)
float *GetDataSpacing ()

Set/Get the origin of the data (location of first pixel in the file).

void SetDataOrigin (float ,float ,float )
void SetDataOrigin (float *)
float *GetDataOrigin ()

Returns the cache.

vtkImageCache *GetOutput ()

This method returns the largest data that can be generated.

void UpdateImageInformation ()

Get the size of the header computed by this object.

int GetHeaderSize ()
int GetHeaderSize (int )

If there is a tail on the file, you want to explicitly set the header size.

void SetHeaderSize (int )

Set/Get the Data mask.

unsigned short GetDataMask ()

Set/Get transformation matrix to transform the data from slice space into world space. This matirx must be a permutation matrix. To qualify, the sums of the rows must be + or - 1.

void SetDataMask (int )
void SetTransform (vtkTransform *)
vtkTransform *GetTransform ()

These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian.

void SetDataByteOrderToBigEndian ()
void SetDataByteOrderToLittleEndian ()
int GetDataByteOrder ()
void SetDataByteOrder (int )
char *GetDataByteOrderAsString ()

Set/Get the byte swapping to explicitely swap the bytes of a file.

void SetSwapBytes (int )
int GetSwapBytes ()
void SwapBytesOn ()
void SwapBytesOff ()

Set/Get whether the data comes from the file starting in the lower left corner or upper left corner.

void FileLowerLeftOn ()
void FileLowerLeftOff ()
int GetFileLowerLeft ()
void SetFileLowerLeft (int )

Set/Get the internal file name

void ComputeInternalFileName (int )
char *GetInternalFileName ()