Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlVolIterConst< DataType, Layout > Class Template Reference

#include <vlvoliterbase.h>

Inheritance diagram for vlVolIterConst< DataType, Layout >:

vlVolIterBaseConst< DataType > vlVolIterSuperBase vlVolIter< DataType, Layout > List of all members.

Public Member Functions

 vlVolIterConst (const vlVolume *vol)
 Default constructor.

 vlVolIterConst (const vlVolData *data)
virtual ~vlVolIterConst ()
 Default destructor.

bool end ()
 Return true if at the end of the volume.

vlPoint3ui pos ()
 Return the position of the iterator.

bool moveTo (const vlPoint3ui &newPosition)
 move the iterator to voxel at newPosition - for random access

bool moveRelative (const vlOffset &offset)
 move the iterator by offset

DataType get ()
 Get the value of voxel at current position.

DataType getValueAt (const vlPoint3ui &pos)
 Get the value of voxel at the given position.

DataType getValueAt (const vlPoint3f &pos)
 Get the value of voxel at the given position - interpolation will be used.

bool operator++ ()
 move the iterator to the next position - same as next()

bool operator-- ()
 move the iterator to the previous position - same as prev()

bool next ()
 move the iterator to the next voxel - NOTE : No order assumed - fastest traversal

void nextNBC ()
 Same as next() but w/o checking for any bounds.

bool nextXYZ ()
 move the iterator to the next voxel - move first along X, then Y and then Z

bool nextYZX ()
 move the iterator to the next voxel - move first along Y, then Z and then X

bool nextZXY ()
 move the iterator to the next voxel - move first along Z, then X and then Y

bool prev ()
 move the iterator to the previous voxel - NOTE : No order assumed - fastest traversal

void prevNBC ()
 Same as prev() but w/o checking for any bounds.

bool prevXYZ ()
 move the iterator to the previous voxel - move first along X, then Y and then Z

bool prevYZX ()
 move the iterator to the previous voxel - move first along Y, then Z and then X

bool prevZXY ()
 move the iterator to the previous voxel - move first along Z, then X and then Y

DataType getRelative (const vlOffset &offset)
 get value at a voxel with position delta from the current one

DataType getRelativeNBC (const vlTriple< int32 > &delta)
 Same as getRelative but with NBC = No Boundary Check, thus faster.

DataType getRelative (const vlPoint3f &delta)
 Get value at a point delta from the curret position of the iterator.

DataType getRelativeX (const int32 offset)
 Get the voxel along X axis.

DataType getRelativeY (const int32 offset)
 Get the voxel along Y axis.

DataType getRelativeZ (const int32 offset)
 Get the voxel along Z axis.

bool setNeighborhood (const vlNeighborhood &neighborhood)
 Set the neighborhood of the current voxel to access.

DataType getNeighbor ()
 Get the value stored at currently selected neighboring voxel.

vlOffset getNeighborOffset ()
 Get the offset of the current neighbor in the neighborhood.

uint16 getNeighborId ()
 Get the id of the current neighbor in the neighborhood.

bool nextNeighbor ()
 Move the neighbor pointer to the next neighbor in the neighborhood list.

bool firstNeighbor ()
 Move the neighbor pointer to the first neighbor in the neighborhood list.

bool endOfNeighborhood ()
 This function checks if end of neighborhood is reached.

bool outside ()
 Returns true if the outside flag was set.

void resetOutside ()
 Explicitly reset the outside flag.

bool setInterpolation (const vlInterpolationType type)
 Set the type of interpolation to use whenever the need arises.

bool setInterpolation (const std::string &name)
 Same as previous function, except that it takes the name of interpolation as argument.

vlInterpolatorBase< DataType
> const * 
getInterpolator ()
 Returns pointer to the interpolator being used.

bool setVoxelOperation (const vlVoxelOpType type)
 Set the type of voxel operator to use.

bool setVoxelOperation (const std::string &name)
 Same as previous function, except that it takes the name of voxel operator as argument.

vlVoxelOpBase< DataType
> const * 
getVoxelOperator ()
 Returns pointer to the voxel operator being used.

bool getOp (DataType &value)
 Gets the value computed by the voxel operator.

bool getOp (vlVoxelOpValue &value)
 Gets the value computed by the voxel operator.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
class vlVolIterConst< DataType, Layout >


Constructor & Destructor Documentation

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlVolIterConst< DataType, Layout >::vlVolIterConst const vlVolume vol  )  [inline]
 

Definition at line 399 of file vlvoliterbase.h.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlVolIterConst< DataType, Layout >::vlVolIterConst const vlVolData data  )  [inline]
 

Definition at line 405 of file vlvoliterbase.h.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
virtual vlVolIterConst< DataType, Layout >::~vlVolIterConst  )  [inline, virtual]
 

Definition at line 412 of file vlvoliterbase.h.


Member Function Documentation

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::end  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolProcessorAlphaAdd::alphaAddReal(), GaussianApprox::computeApproxGaussBlur(), vlVolProcessorSobel::runT(), and vlVolProcessorCentralDiff::runT().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::endOfNeighborhood  )  [virtual]
 

If it has reached, it returns true, else it returns false. End of neighborhood is defined as a call to nextNeighbor() when there are no more neighbors. That is, when nextNeighbor() is called while at the last neighbor. This function is useful mainly to write neat and easy-to-understand code like this:

 while(!iter.endOfNeighborhood()) {
  std::cout << iter.getNeighbor() << std::flush;
  iter.nextNeighbor();
 }

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::firstNeighbor  )  [virtual]
 

Call this function to restart looping over the neighboring voxels.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::get  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolProcessorAlphaAdd::alphaAddReal(), GaussianApprox::computeApproxGaussBlur(), vlVolume::copyDataT(), vlVolProcessorConcatenate::copyDataT(), CreateVolume(), vlVolume::cropREDtoRGBA(), vlVolume::cropRGBtoRed(), vlVolume::cropRGBtoRGBA(), vlVolume::cropSliceT(), vlSlice::extractXSlice(), vlSlice::extractYSlice(), vlSlice::extractZSlice(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), vlInterpolatorNearestNeighbor< DataType, Layout >::getValueAt(), vlInterpolatorTriLinear< DataType, Layout >::getValueAtOffset(), main(), vlVolProcessorRegionGrow::regionGrowReal(), vlVolProcessorThresh::thresholding(), vlVolFioSLC::writeData(), vlVolFioPPM::writeData(), vlVolFioDEN::writeData(), vlVolFioVOX::writeDataT(), vlVolFioRAW::writeDataT(), vlVolFioPGMVol::writeDataT(), and vlVolFiof3d::writeDataT().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlInterpolatorBase<DataType> const* vlVolIterConst< DataType, Layout >::getInterpolator  )  [virtual]
 

Returns 0L if no interpolator is set. This pointer can be used to get the type and name of the interpolator.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getNeighbor  )  [virtual]
 

If a neighborhood is setup using a call to setNeighborhood(..), then there will always be a neighboring voxel that is selected at any given time. This function call will return the value at that voxel.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
uint16 vlVolIterConst< DataType, Layout >::getNeighborId  )  [virtual]
 

This id is basically the position of the neighbor in the neighborhood list. Thus, this id can be used to access the neighbor's properties stored in vlNeighborhood or the classes that derive from it.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlOffset vlVolIterConst< DataType, Layout >::getNeighborOffset  )  [virtual]
 

The offset is the location of the neighbor w.r.t. the current location.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::getOp vlVoxelOpValue value  )  [virtual]
 

Use this function call when the voxel operation returns arbitrary data (i.e. not a voxel). Make sure you have set the voxel operator using setVoxelOp(...) before calling this function.

See also:
setVoxelOp()

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::getOp DataType &  value  )  [virtual]
 

Use this function call when the voxel operation returns a voxel as a result. Make sure you have set the voxel operator using setVoxelOp(...) before calling this function.

See also:
setVoxelOp()

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolProcessorSobel::runT(), and vlVolProcessorCentralDiff::runT().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelative const vlPoint3f delta  )  [virtual]
 

This will be an iterpolated value. Set the type of interpolation using setIterpolation()

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelative const vlOffset offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by GaussianApprox::computeApproxGaussBlur(), vlVolProcessorDilate::dilateReal(), vlVolProcessorErode::erodeReal(), vlVoxelOpSobel< DataType, Layout >::getValue(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), vlInterpolatorTriLinear< DataType, Layout >::getValueAtOffset(), vlInterpolatorNearestNeighbor< DataType, Layout >::getValueAtOffset(), vlRegionGrowOffsetFinder::regionGrowOffsets(), and vlVolProcessorRegionGrow::regionGrowReal().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelativeNBC const vlTriple< int32 > &  delta  ) 
 

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelativeX const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by GaussianApprox::computeApproxGaussBlur(), vlVoxelOpSobel< DataType, Layout >::getValue(), vlVoxelOpCentralDiff< DataType, Layout >::getValue(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), and vlInterpolatorTriLinear< DataType, Layout >::getValueAtOffset().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelativeY const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by GaussianApprox::computeApproxGaussBlur(), vlVoxelOpSobel< DataType, Layout >::getValue(), vlVoxelOpCentralDiff< DataType, Layout >::getValue(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), and vlInterpolatorTriLinear< DataType, Layout >::getValueAtOffset().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getRelativeZ const int32  offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVoxelOpSobel< DataType, Layout >::getValue(), vlVoxelOpCentralDiff< DataType, Layout >::getValue(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), and vlInterpolatorTriLinear< DataType, Layout >::getValueAtOffset().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getValueAt const vlPoint3f pos  )  [virtual]
 

Set the type of interpolation to use using setInterpolation().

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
DataType vlVolIterConst< DataType, Layout >::getValueAt const vlPoint3ui pos  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlVoxelOpBase<DataType> const* vlVolIterConst< DataType, Layout >::getVoxelOperator  )  [virtual]
 

Returns 0L if no voxel operator is used. This pointer can be used to get the type and name of the voxel operator. In addition, this can be used to optionally configure the operator.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::moveRelative const vlOffset offset  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::moveTo const vlPoint3ui newPosition  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolume::copyDataT(), vlVolProcessorConcatenate::copyDataT(), CreateVolume(), vlVolume::cropREDtoRGBA(), vlVolume::cropRGBtoRed(), vlVolume::cropRGBtoRGBA(), vlVolume::cropSliceT(), vlVolProcessorDilate::dilateReal(), vlVolProcessorErode::erodeReal(), vlSlice::extractXSlice(), vlSlice::extractYSlice(), vlSlice::extractZSlice(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), vlInterpolatorNearestNeighbor< DataType, Layout >::getValueAt(), vlVolIterConst< DataType, LayoutType >::nextYZX(), vlVolIterConst< DataType, LayoutType >::nextZXY(), vlVolIterConst< DataType, LayoutType >::prevYZX(), vlVolIterConst< DataType, LayoutType >::prevZXY(), vlVolProcessorRegionGrow::regionGrow(), vlRegionGrowOffsetFinder::regionGrowOffsets(), and vlVolProcessorRegionGrow::regionGrowReal().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::next  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolProcessorAlphaAdd::alphaAddReal(), GaussianApprox::computeApproxGaussBlur(), main(), vlVolFioRAW::readData(), vlVolFioSLC::writeData(), and vlVolFioPPM::writeData().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
void vlVolIterConst< DataType, Layout >::nextNBC  )  [virtual]
 

WARNING : Using this w/o proper thought is dangerous. You have been warned! This is simply the fastest way to move to the next voxel. You need to do bounds-checking yourself, else the pointer can easily go outside the data range.

See also:
next()

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::nextNeighbor  )  [virtual]
 

If there are no more neighbors left, then the function will return false.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::nextXYZ  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolume::copyDataT(), vlVolProcessorConcatenate::copyDataT(), CreateVolume(), vlVolume::cropREDtoRGBA(), vlVolume::cropRGBtoRed(), vlVolume::cropRGBtoRGBA(), vlVolume::cropSliceT(), vlSlice::extractZSlice(), vlVolFioSLC::readData(), vlVolFioDEN::readData(), vlVolFioPGMVol::readDataT(), vlVolFiof3d::readDataT(), vlVolProcessorSobel::runT(), vlVolProcessorCentralDiff::runT(), vlVolProcessorThresh::thresholding(), vlVolFioDEN::writeData(), vlVolFioVOX::writeDataT(), vlVolFioRAW::writeDataT(), vlVolFioPGMVol::writeDataT(), and vlVolFiof3d::writeDataT().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::nextYZX  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlSlice::extractXSlice().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::nextZXY  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by vlSlice::extractYSlice().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::operator++  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::operator--  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::outside  )  [virtual]
 

The outside flag is set whenever a get*() function is called (except the NBC versions). It is set to true if the get*() tried to access outside the volume (in which case it returned zero). It is set to false, if the get call was successful. Thus, by querying this flag, you can find out if get*() was inside volume. The reason why outside flag works only for get*() functions is that these functions have no way to return if they were successful or not (since they return voxel value). All other functions return bool indicating if the function was successful.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
vlPoint3ui vlVolIterConst< DataType, Layout >::pos  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

Referenced by CreateVolume(), vlVolIterConst< DataType, LayoutType >::getRelative(), vlInterpolatorTriLinear< DataType, Layout >::getValueAt(), vlInterpolatorNearestNeighbor< DataType, Layout >::getValueAt(), vlVolIterConst< DataType, LayoutType >::moveRelative(), vlRegionGrowOffsetFinder::regionGrowOffsets(), and vlVolProcessorRegionGrow::regionGrowReal().

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::prev  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
void vlVolIterConst< DataType, Layout >::prevNBC  )  [virtual]
 

WARNING : Using this w/o proper thought is dangerous. You have been warned! This is simply the fastest way to move to the previous voxel. You need to do bounds-checking yourself, else the pointer can easily go outside the data range.

See also:
prev()

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::prevXYZ  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::prevYZX  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::prevZXY  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
void vlVolIterConst< DataType, Layout >::resetOutside  )  [virtual]
 

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::setInterpolation const std::string &  name  )  [virtual]
 

Do not use this function unless you want to use a interpolation plugin about which OpenVL has no idea (i.e. there is no interpolation type specified in vlInterpolationType.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::setInterpolation const vlInterpolationType  type  )  [virtual]
 

For e.g., getValueAt(float) will need interpolation to get value at non-grid points.

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::setNeighborhood const vlNeighborhood neighborhood  )  [virtual]
 

A neighborhood is defined by a list of offsets stored in the vlNeighborhood object.

See also:
vlNeighborhood

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::setVoxelOperation const std::string &  name  )  [virtual]
 

Do not use this function unless you want to use a voxel operator plugin about which OpenVL has no idea (i.e. there is no voxel operator type specified in vlVoxelOpType)

Implements vlVolIterBaseConst< DataType >.

template<typename DataType, vlLayoutType Layout = vlLayout::DefaultLayout>
bool vlVolIterConst< DataType, Layout >::setVoxelOperation const vlVoxelOpType  type  )  [virtual]
 

This operator will be used to perform the operation when getOp() is called.

Implements vlVolIterBaseConst< DataType >.

Referenced by vlVolProcessorSobel::runT(), and vlVolProcessorCentralDiff::runT().


The documentation for this class was generated from the following file:
Generated on Fri Mar 18 11:33:22 2005 for OpenVL by doxygen 1.3.3