aimsdata  5.1.2
Neuroimaging data handling
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 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 25 of file borderiterator.h.

Constructor & Destructor Documentation

◆ BorderIterator() [1/3]

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 49 of file borderiterator.h.

References aims::BorderIterator< T >::_sizeinf, aims::BorderIterator< T >::_sizesup, aims::BorderIterator< T >::_volume, and carto::VolumeRef< class >::getBorders().

◆ BorderIterator() [2/3]

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

◆ BorderIterator() [3/3]

template<typename T >
aims::BorderIterator< T >::BorderIterator ( )
inline

Definition at line 114 of file borderiterator.h.

Member Function Documentation

◆ begin() [1/2]

◆ begin() [2/2]

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

Definition at line 240 of file borderiterator.h.

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

◆ end() [1/2]

◆ end() [2/2]

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

Definition at line 241 of file borderiterator.h.

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

◆ operator==()

Friends And Related Function Documentation

◆ const_iterator

template<typename T >
friend class const_iterator
friend

◆ iterator

template<typename T >
friend class iterator
friend

Member Data Documentation

◆ _inside

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

Definition at line 253 of file borderiterator.h.

Referenced by aims::BorderIterator< T >::operator==().

◆ _sizeinf

template<typename T >
Point4dl aims::BorderIterator< T >::_sizeinf
protected

◆ _sizesup

template<typename T >
Point4dl aims::BorderIterator< T >::_sizesup
protected

◆ _volume

template<typename T >
carto::VolumeRef<T> aims::BorderIterator< T >::_volume
protected

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