Man Page for vtkImageRegion
Table of Contents

NAME

vtkImageRegion - Piece of image.

SYNOPSIS


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

class VTK_EXPORT vtkImageRegion : public vtkImageSource

vtkImageRegion();
~vtkImageRegion();
static vtkImageRegion *New() {return new vtkImageRegion;};
const char *GetClassName() {return "vtkImageRegion";};
void PrintSelf(ostream& os, vtkIndent indent);
void SetAxes(int dim, int *axes);
void SetAxes( int);
void GetAxes(int dim, int *axes);
int GetAxes();
int *GetAxes() {return this->Axes;};
void SetExtent(int dim, int *extent);
int GetAxes();
void SetAxisExtent(int axis, int min, int max);
void GetAxisExtent(int axis, int &min, int &max);
void GetExtent(int dim, int *extent);
int GetAxes();
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);}
void SetScalarType(int type);
int GetScalarType();
void InternalUpdate();
void UpdateImageInformation();
unsigned long GetPipelineMTime();
void SetData(vtkImageData *data);
vtkImageData *GetData();
void ReleaseData();
void MakeData();
void GetIncrements(int dim, int *increments);
int GetIncrements();
int *GetIncrements() {return this->Increments;};
void GetAxesIncrements(int num, int *axes, int *incs);
void GetAxisIncrements(int axis, int &inc);
void *GetScalarPointer(int dim, int *coordinates);
int GetIncrements();
void *GetScalarWritePointer(int dim, int *coordinates)
{this->MakeScalarsWritable();return this->GetScalarPointer(dim,coordinates);}
int GetIncrements();
void SetWholeExtent(int dim, int *extent);
int GetIncrements();
void SetAxisWholeExtent(int axis, int min, int max);
void GetWholeExtent(int dim, int *extent);

int GetIncrements();
void SetSpacing(int dim, float *ratio);
void SetSpacing( float);
void GetSpacing(int dim, float *ratio);
float GetSpacing();
float *GetSpacing() {return this->Spacing;};
void SetOrigin(int dim, float *origin);
void SetOrigin( float);
void GetOrigin(int dim, float *origin);
float GetOrigin();
float *GetOrigin() {return this->Origin;};
void CopyRegionData(vtkImageRegion *region);
void Fill(float value);
int GetExtentMemorySize();
int IsEmpty() {return (Extent[1] < Extent[0]
|| Extent[3] < Extent[2]
|| Extent[5] < Extent[4]
|| Extent[7] < Extent[6]
|| Extent[9] < Extent[8]);};
int AreScalarsAllocated()
{return this->Data && this->Data->AreScalarsAllocated();};
void AllocateScalars();
static void ChangeVectorCoordinateSystem(int *vectIn, int *axesIn,
int *vectOut, int *axesOut);
static void ChangeVectorCoordinateSystem(float *vectIn, int *axesIn,
float *vectOut, int *axesOut);
static void ChangeExtentCoordinateSystem(int *extentIn, int *axesIn,
int *extentOut, int *axesOut);
static void CompleteUnspecifiedAxes(int num, int *axesIn, int *axesOut);
void MakeDataWritable();
void MakeScalarsWritable()
{this->MakeDataWritable(); this->Data->MakeScalarsWritable();};

DESCRIPTION

vtkImageRegion holds a piece of an image. The actual data for the image is stored in the vtkImageData object. The vtkImageRegion can represent a portion of its vtkImageData, hiding the actual extent of the vtkImageData. It can also transparently reorder the axes of the data with out coping the data. The Increments are used to march around the data using pointer arithmetic, without knowing the actual dimensions of the underlying data. Both the increments and extent of the region are relative to the regions axes. They get reshuffled when the axes are changed.
A region is usually manipulated by the image pipeline behind the scenes, but it can also be used as an input to a filter for more explicit operaation.

SUMMARY

void SetAxes( int)
Different methods for setting and getting the axes. The only function of the Axes instance variable is to specify a context for the other filter instance variables. The affect of this variable is local to this region, and does not change the behavior of any filter that operates on this region.

void SetAxes( int)
Different methods for setting the extent. The 2d and 1d functions do not modify extent of the higher dimensions.

void SetAxes( int)
Different methods for getting the extent.

int GetScalarType()
Set/Get the data type of this region.

int GetIncrements()
"Increments" allows the user to efficiently march through the memory using pointer arithmetic, while keeping the actual dimensions of the memory array hidden. Increments do not include size of data type, so should be used after pointers have been casted to their actual type.

int GetIncrements()
Returns a pointer for reading the scalar point data. Coordinates are relative to image origin. Extent mins are used for unspecified coordinates.

int GetIncrements()
Returns a pointer for writing into the scalar point data. Coordinates are relative to image origin. Extent mins are used for unspecified coordinates.

int GetIncrements()
Different methods for setting the WholeExtent. The 2d and 1d functions do not modify WholeExtent of the higher dimensions. The image extent is the largest region that can be requested from the pipeline.

int GetIncrements()
Different methods for getting the WholeExtent.

void SetSpacing( float)
Different methods for setting the data spacing. The 2d and 1d functions do not modify the data spacing of the higher dimensions.

float GetSpacing()
Different methods for getting the data spacing.

void SetOrigin( float)
Different methods for setting the Origin.

float GetOrigin()
Different methods for getting the Origin.

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

~vtkImageRegion()
Destructor: Deleting a vtkImageRegion automatically deletes the associated vtkImageData. However, since the data is reference counted, it may not actually be deleted.

template static void vtkImageRegionChangeVectorCoordinateSystem(T *vectIn, int

*axesIn,
T *vectOut, int *axesOut) Convert 4d vector (not extent!) from one coordinate system into another coordinate system. "vectIn" and "vectOut" may be the same array.

void ChangeExtentCoordinateSystem(int *extentIn, int
*axesIn,
int *extentOut, int *axesOut) Convert 4d extent from one coordinate system into another. "extentIn" and "extentOut" may be the same array.

void CompleteUnspecifiedAxes(int num, int *axesIn, int *axesOut)
This method determines the order of unspecified axes. By default lower enumerated axes come first. This method is used by vtkImageRegion and vtkImageData.

void MakeDataWritable()
This function makes sure we are the only one referenceing the data. The data object is copied if necessary. It does not make the point data writable.

void InternalUpdate()
Right now, the data is used for the new region with no eror checking. Don't ask for for a larger region than this one! This implementation also ignores the relative coordinates of the regions. If this becomes a problem, an execute method that copies the data cound be created.

void UpdateImageInformation()
Returns the extent of the region as the image extent.

unsigned long GetPipelineMTime()
Just the MTime of this region.

void AllocateScalars()
When dealing with Regions directly (no caches), they can be allocated with this method. It keeps you from having to create a vtkImageData object and setting it explicitley.

void ReleaseData()
Release any data in the region

void CopyRegionData(vtkImageRegion *region)
Copies data from a region into this region (converting data type). It is a simple cast, and will not deal with float to unsigned char inteligently. If regions do not have the same extent, the intersection is copied. The coordinate systems (Axes) of the two regions are important. This method can be used to switch the labeling of the axes (rather inefficiently).

void Fill(float value)
This function sets all the pixels in a region to the specified value.

void SetScalarType(int type)
Sets the scalar type of the region. The region should not be allocated yet.

void MakeData()
If the data of this region is not going to be set explicitely, this method can be used to make a new data object for the region. Extent, and ScalarType should be set before this method is called.

void SetData(vtkImageData *data)
You can set the data object explicitly. Old data is released, and the region automatically registers the new data. This assumes that the Data being set has already been allocated. This method is used mainly by vtkImageCache.

vtkImageData *GetData()
Returns the data. If one does not exist, the a data object is created.

int GetExtentMemorySize()
This method returns the memory that would be required to fill the region. The returned value is in units KBytes. This method is used for determining when to stream.


Table of Contents