A.I.M.S


aims::BorderIterator< T > Class Template Reference

Represents the border of a volume. More...

#include <aims/border/borderiterator.h>

Collaboration diagram for aims::BorderIterator< T >:

Classes

class  const_iterator
 Border: const iterator. More...
 
class  iterator
 Border: iterator. More...
 

Public Member Functions

 BorderIterator (carto::VolumeRef< T > in, bool inside=false, const Point4dl &size=Point4dl(-1,-1,-1,-1))
 Border constructor. More...
 
 BorderIterator (carto::VolumeRef< T > in, bool inside, const Point4dl &sizeinf, const Point4dl &sizesup)
 
 BorderIterator ()
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool operator== (const BorderIterator< T > &other) const
 

Protected Member Functions

Point4dl jump (const Point4dl &move)
 utility method used by the iterators It gives the size of the non-border volume in selected dimensions. More...
 

Protected Attributes

carto::VolumeRef< T > _volume
 
bool _inside
 
Point4dl _sizeinf
 
Point4dl _sizesup
 

Friends

class const_iterator
 
class iterator
 

Detailed Description

template<typename T>
class aims::BorderIterator< T >

Represents the border of a volume.

This border can be outside (if volume with borders are used and enough memory is allocated) or inside. It is defined by a Volume Ref, a border size and its direction (inside or outside)

Iterators (const and non const) are defined for this class. They allow to easily run through all border voxels. Those iterators implement the classic iterator operators (assignment, increment, ...). They also have a coordinates() method that returns the position of the current voxel in the volume.

Definition at line 26 of file borderiterator.h.

Constructor & Destructor Documentation

template<typename T>
aims::BorderIterator< T >::BorderIterator ( carto::VolumeRef< T >  in,
bool  inside = false,
const Point4dl size = Point4dl( -1, -1, -1, -1 ) 
)
inline

Border constructor.

Parameters
inInput volume whise border voxels to iterate
insideIf false consider "outside" border (with coordinates outside the volume dimensions). If true consider "inside" border
sizeborder size in each dimension. If inside is true, size must be >= 0 in each dim. If inside is false and a size dim has negative value, the maximum possible border in this dimension is computed.
// 1 voxel inside border in a 3D volume:
Border b1( in, true, Point4dl(1,1,1,0) );
// 2 voxels outside border in a 2D volume
Border b2( in, false, Point4dl(2,2,0,0) );
// All existing border in a volume
Border b3( in );

Definition at line 50 of file borderiterator.h.

References aims::BorderIterator< T >::_sizeinf, aims::BorderIterator< T >::_sizesup, and aims::BorderIterator< T >::_volume.

template<typename T>
aims::BorderIterator< T >::BorderIterator ( carto::VolumeRef< T >  in,
bool  inside,
const Point4dl sizeinf,
const Point4dl sizesup 
)
inline
template<typename T>
aims::BorderIterator< T >::BorderIterator ( )
inline

Definition at line 118 of file borderiterator.h.

Member Function Documentation

template<typename T>
const_iterator aims::BorderIterator< T >::begin ( ) const
inline

Definition at line 246 of file borderiterator.h.

References aims::BorderIterator< T >::const_iterator.

template<typename T>
const_iterator aims::BorderIterator< T >::end ( ) const
inline

Definition at line 247 of file borderiterator.h.

References aims::BorderIterator< T >::const_iterator.

template<typename T>
Point4dl aims::BorderIterator< T >::jump ( const Point4dl move)
inlineprotected

utility method used by the iterators It gives the size of the non-border volume in selected dimensions.

This jump is returned for each dimension in which move is not zero

Definition at line 262 of file borderiterator.h.

References aims::BorderIterator< T >::_inside, aims::BorderIterator< T >::_sizeinf, aims::BorderIterator< T >::_sizesup, and aims::BorderIterator< T >::_volume.

template<typename T>
bool aims::BorderIterator< T >::operator== ( const BorderIterator< T > &  other) const
inline

Friends And Related Function Documentation

template<typename T>
friend class const_iterator
friend
template<typename T>
friend class iterator
friend

Member Data Documentation

template<typename T>
bool aims::BorderIterator< T >::_inside
protected

The documentation for this class was generated from the following file: