Man Page for vtkImageData
Table of Contents

NAME

vtkImageData - Similar to structured points.

SYNOPSIS


#include "/opt/vtk-c++/common/vtkImageData.h"

class VTK_EXPORT vtkImageData : public vtkReferenceCount

vtkImageData();
static vtkImageData *New() {return new vtkImageData;};
const char *GetClassName() {return "vtkImageData";};
void PrintSelf(ostream& os, vtkIndent indent);
void SetExtent(int num, int *extent);
void SetAxisExtent(int axis, int min, int max);
int *GetExtent() {return this->Extent;}
void GetAxisExtent(int axis, int &min, int &max);
void GetAxes(int num, int *axes);
int GetAxes();
int *GetAxes(){return this->Axes;}
void GetMemoryOrder(int num, int *axes);
int *GetMemoryOrder(){return this->MemoryOrder;}
void SetScalarType(int type);
void SetScalarTypeToFloat(){this->SetScalarType(VTK_FLOAT);}
void SetScalarTypeToInt(){this->SetScalarType(VTK_INT);}
void SetScalarTypeToShort(){this->SetScalarType(VTK_SHORT);}
void SetScalarTypeToUnsignedShort(){this->SetScalarType(VTK_UNSIGNED_SHORT);}
void SetScalarTypeToUnsignedChar(){this->SetScalarType(VTK_UNSIGNED_CHAR);}
int GetScalarType();
void GetIncrements(int dim, int *incs);
void GetAxisIncrement(int axis, int &inc);
int *GetIncrements(){return this->Increments;}
int AreScalarsAllocated();
void MakeScalarsWritable();
void SetScalars(vtkScalars *scalars);
void *GetScalarPointer(int coordinates[VTK_IMAGE_DIMENSIONS]);
void *GetScalarPointer();
vtkScalars *GetScalars(){return this->PointData.GetScalars();};
void SetPrintScalars(int);
int GetPrintScalars();
void PrintScalarsOn();
void PrintScalarsOff();

DESCRIPTION

vtkImageData is the basic image data structure specific to the image pipeline. The axes cannot be reordered as in vtkImageRegion. All the ivars are accessed as if the Axes were set to (0,1,2,3,4). The extent represetns the actual dimensions of the underlying memory. The actual memory is stored in objects (vtkPointData,vtkScalars,vtkArray) used in the visualization pipline, so transfer of data is efficient. Cuurently, only the only contents of PointData used are the Scalars, and vtkColorScalars are excluded. The underlying memory can be any data type.

DEFINED MACROS

VTK_IMAGE_DIMENSIONS 5
VTK_IMAGE_EXTENT_DIMENSIONS 10
VTK_VOID
0
VTK_FLOAT
1
VTK_INT
2
VTK_SHORT
3 VTK_UNSIGNED_SHORT 4 VTK_UNSIGNED_CHAR 5 vtkImageScalarTypeNameMacro(type) VTK_IMAGE_X_AXIS 0 VTK_IMAGE_Y_AXIS 1 VTK_IMAGE_Z_AXIS 2 VTK_IMAGE_TIME_AXIS 3 VTK_IMAGE_COMPONENT_AXIS 4 VTK_IMAGE_USER_DEFINED_AXIS 5 vtkImageAxisNameMacro(axis)

SUMMARY

int GetAxes()
Different ways to set the extent of the data array. The extent should be set before the "Scalars" are set or allocated. The Extent is stored in the order (X, Y, Z, Time, Components). The Axes instance variable is fixed to (X, Y, Z, Time, Components). The access method is supplied for compatablilty.

int GetScalarType()
The MemoryOrder instance variable specifies how the axes are arranged in memory. It is currently fixed to (COMPONENTS X, Y, Z, Time), but might be arbitrary in the future. The ScalarType determines the contents of the underlying memory. The ScalarType cannot be changed after the data has been allocated.

void SetPrintScalars(int)
Different ways to get the increments for moving around the data. They are store (X, Y, Z, Time, Components). A flag that determines wheter to print the data or not.

vtkImageData()
Construct an instance of vtkImageData with no data.

void ComputeIncrements()
This method computes the increments from the MemoryOrder and the extent. It also computes "NumberOfScalars".

int AreScalarsAllocated()
This method returns 1 if the scalar data has been allocated.

int AllocateScalars()
This method allocates memory for the vtkImageData scalars. The extent of the data object and the ScalarType should be set before this method is called. The method returns 1 if the allocation was sucessful, 0 if not.

void MakeScalarsWritable()
This method makes sure the scalars are allocated, and we have the only reference. It copies the scalars if necessary.

void SetScalars(vtkScalars *scalars)
You can set the scalars directly (instead of allocating), but you better make sure that the extent are set properly before this method is called. This method is here (instead of GetPointData()->SetScalars) because ScalarType Needs to be set. This may change in the future.

void
*GetScalarPointer(int coordinates[VTK_IMAGE_DIMENSIONS]) This Method returns a pointer to a location in the vtkImageData. Coordinates are in pixel units and are relative to the whole image origin.

void *GetScalarPointer()
This Method returns a pointer to the origin of the vtkImageData.


Table of Contents