Man Page for vtkImageCache
Table of Contents

NAME

vtkImageCache - Caches are used by vtkImageSource.

SYNOPSIS


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

class VTK_EXPORT vtkImageCache : public vtkObject

vtkImageCache();
~vtkImageCache();
static vtkImageCache *New() {return new vtkImageCache;};
const char *GetClassName() {return "vtkImageCache";};
void PrintSelf(ostream& os, vtkIndent indent);
void SetUpdateExtent(int extent[8]);
void SetUpdateExtent(int xMin, int xMax, int yMin, int yMax,
int zMin, int zMax, int tMin, int tMax);
void SetAxesUpdateExtent(int num, int *axes, int *extent);

void SetUpdateExtentToWholeExtent();
void GetUpdateExtent(int extent[8]);
int *GetUpdateExtent() {return this->UpdateExtent;}
void GetUpdateExtent(int &xMin, int &xMax, int &yMin, int &yMax,
int &zMin, int &zMax, int &tMin, int &tMax);
void GetAxesUpdateExtent(int num, int *axes, int *extent);

void ClipUpdateExtentWithWholeExtent();
virtual void Update();
virtual void UpdateImageInformation();
virtual unsigned long GetPipelineMTime();
vtkImageRegion *GetScalarRegion();
vtkImageRegion *GetVectorRegion();
void SetWholeUpdateExtent(int *extent);
void SetSpacing(float spacing[4]);
void SetSpacing(float x, float y, float z, float t);
void SetSpacing(float x, float y, float z) {this->SetSpacing(x,y,z,1.0);};
void SetAxesSpacing(int num, int *axes, float *spacing);

void GetSpacing(float spacing[4]);
float *GetSpacing() {return this->Spacing;}
void GetSpacing(float &x, float &y, float &z, float &time);
void GetAxesSpacing(int num, int *axes, float *spacing);

void SetOrigin(float origin[4]);
void SetOrigin(float x, float y, float z, float t);
void SetOrigin(float x, float y, float z) {this->SetOrigin(x,y,z,0.0);};
void SetAxesOrigin(int num, int *axes, float *origin);

void GetOrigin(float origin[4]);
float *GetOrigin() {return this->Origin;}
void GetOrigin(float &x, float &y, float &z, float &time);
void GetAxesOrigin(int num, int *axes, float *origin);
void SetWholeExtent(int extent[8]);
void SetWholeExtent(int xMin, int xMax, int yMin, int yMax,
int zMin, int zMax, int tMin, int tMax);
void SetAxesWholeExtent(int num, int *axes, int *extent);

void GetWholeExtent(int extent[8]);
int *GetWholeExtent() {return this->WholeExtent;}
void GetWholeExtent(int &xMin, int &xMax, int &yMin, int &yMax,
int &zMin, int &zMax, int &tMin, int &tMax);
void GetAxesWholeExtent(int num, int *axis, int *extent);

void GetDimensions(int dimensions[4]);
int *GetDimensions() {return this->Dimensions;}
void GetDimensions(int &x, int &y, int &z, int &time);
void GetAxesDimensions(int num, int *axes, int *dimensions);

void GetCenter(float center[4]);
float *GetCenter() {return this->Center;}
void GetCenter(float &x, float &y, float &z, float &time);
void GetAxesCenter(int num, int *axes, float *center);

void GetBounds(float bounds[8]);
float *GetBounds() {return this->Bounds;}
void GetBounds(float &xMin, float &xMax, float &yMin, float &yMax,
float &zMin, float &zMax, float &tMin, float &tMax);
void GetAxesBounds(int num, int *axes, float *bounds);

void SetSource(vtkImageSource*);
void SetSource(vtkImageSource& );
vtkImageSource *GetSource();
void SetReleaseDataFlag(int value);
int GetReleaseDataFlag();
void ReleaseDataFlagOn();
void ReleaseDataFlagOff();
void SetGlobalReleaseDataFlag(int val);
void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
int GetGlobalReleaseDataFlag();
virtual void ReleaseData();
int ShouldIReleaseData();
void SetDataReleased(int);
int GetDataReleased();
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);
int GetScalarType();
long GetUpdateExtentMemorySize();
void SetNumberOfScalarComponents(int);
int GetNumberOfScalarComponents();
int GetNumberOfScalarComponents();
vtkImageData *GetScalarData();
void CacheScalarData(vtkImageData *data);
vtkImageToStructuredPoints *GetImageToStructuredPoints();

DESCRIPTION

vtkImageCache is the super class of all image caches. If the cached source descides to generate in pieces, the caches collects all of the pieces into a single vtkImageRegion object. The cache can also save vtkImageData objects between UpdateRegion messages, to avoid regeneration of data. Since regions can be any size or location, caching strategies can be numerous and complex. Applications can create caches that fit their special needs. The caches access methods do not make any internal checks to make sure the data is up to date. Update has to be called explicitly. to ensure the information retrieved is valid.

SUMMARY

vtkImageData *GetScalarData();
This method sets the instance variable "UpdateExtent" which specifies the extent of the image that will be updated. Extent is specified and a (min,max) value for each axis (in the order X, Y, Z, Time). All the "Components" of vectors and scalars are generated all the
time. If "UpdateExtent" has not been set by the first update, it defaults to the "WholeExtent". If the UpdateExtent is larger than the "WholeExtent" then "UpdateExtent" will be reduced, and a waring message will occur.

vtkImageData *GetScalarData();
These methods give access to the cached image information. "UpdateImageInformation", or "Update" should be
called before the get methods are called.. The set methods are used by the source to update the values.

vtkImageData *GetScalarData();
These duplicate the above and also provide compatability with vtkImageStructuredPoints. Note: The result of these calls depends on the coordinate system! Note: These methods provide image information, not the data in the cache.

void SetSource(vtkImageSource*)
void SetSource(vtkImageSource& )
Set/Get the source associated with this cache

int GetReleaseDataFlag()
Turn the caching of data on or off. When this flag is off, The cache releases the data imediately after the region is returned by the methods "GetScalarRegion", and "GetVectorRegion". The default value of "ReleaseDataFlag" is on.

virtual void ReleaseData();
Turn on/off flag to control whether every object releases its data after being used by a filter. These methods do nothing for now.

void SetDataReleased(int)
Return flag indicating whether data should be released after use by a filter. Keep track of when data was released for pipeline execution test.

void SetScalarType(int)
Set/Get the data scalar type of the regions created by this cache.

void SetNumberOfScalarComponents(int)
The number of scalar components refers to the number of scalars per pixel to store color information.

void SetNumberOfScalarComponents(int)
Here for Bypass functionality !!! DATA SHOULD NOT BE SET EXPLICITELY !!! USE CacheScalarData

vtkImageCache()
Constructor: By default caches ReleaseDataFlags are turned off. However, the vtkImageSource method CheckCache, which create a default cache, turns this flag on. If a cache is created and set explicitely, by default it saves its data between generates. But if the cache is created automatically by the vtkImageSource, it does not.

void Update()
This method updates the region specified by "UpdateExtent".

void UpdateImageInformation()
This method updates the instance variables "WholeExtent", "Spacing", "Origin", "Bounds" etc. It needs to
be separate from "Update" because the image information may be needed to compute the required UpdateExtent of the input (see "vtkImageFilter").

void UpdateImageInformation(unsigned long pipelineMTime) Make this a separate method to avoid another GetPipelineMTime call.

void ClipUpdateExtentWithWholeExtent()
Clip updateExtent so it will nopt be larger than

WHoleExtent

unsigned long GetPipelineMTime()
Make this a separate method to avoid another GetPipelineMTime call.

vtkImageRegion *GetScalarRegion()
This method returns a "vtkImageRegion" that holds the scalar data of the cache. Source must delete the region when finished with it. It assumes that the UpdateExtent has already been cliped. (i.e. This method is called after an update)

void CacheScalarData(vtkImageData *data)
Here for Bypass functionality. I just can not seem to get rid of CacheScalarData method.

void SetWholeUpdateExtent(int *extent)
Here for Bypass functionality. I just can not seem to get rid of CacheScalarData.

vtkImageRegion *GetVectorRegion()
This method returns a "vtkImageRegion" that holds the vector data of the cache. Source must delete the region when finished with it.

void SetReleaseDataFlag(int value)
This Method sets the value of "ReleaseDataFlag" which turns cache on or off. When cache is off, memory will be freed by the consumer.

void ReleaseData()
This method causes the cache to release its data, however it does not affect image infomation.

int ShouldIReleaseData()
Return flag indicating whether data should be released after use by a filter. For now, it does not look at the global release data flag.

long GetUpdateExtentMemorySize()
This method returns the memory that would be required for scalars on update. The returned value is in units KBytes. This method is used for determining when to stream.

vtkImageToStructuredPoints *GetImageToStructuredPoints()
This method is used translparently by the "SetInput(vtkImageCache *)" method to connect the image pipeline to the visualization pipeline.

void ComputeBounds()
This method uses "Spacing" and "WholeExtent" to compute Dimesions, Center, and Bounds.


Table of Contents