aimsdata 6.0.0
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.
 
 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 );
AimsVector< int64_t, 4 > Point4dl

Definition at line 49 of file borderiterator.h.

References _inside, _sizeinf, _sizesup, and _volume.

Referenced by aims::BorderIterator< T >::const_iterator::BorderIterator< T >, aims::BorderIterator< T >::iterator::BorderIterator< T >, aims::BorderIterator< T >::const_iterator::const_iterator(), aims::BorderIterator< T >::const_iterator::const_iterator(), aims::BorderIterator< T >::const_iterator::const_iterator(), aims::BorderIterator< T >::iterator::iterator(), aims::BorderIterator< T >::iterator::iterator(), aims::BorderIterator< T >::iterator::iterator(), and operator==().

◆ BorderIterator() [2/3]

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

Definition at line 81 of file borderiterator.h.

References _inside, _sizeinf, _sizesup, and _volume.

◆ BorderIterator() [3/3]

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

Definition at line 114 of file borderiterator.h.

References _inside, _sizeinf, _sizesup, and _volume.

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 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 const_iterator.

◆ operator==()

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

Friends And Related Symbol Documentation

◆ const_iterator

template<typename T>
friend class const_iterator
friend

Definition at line 257 of file borderiterator.h.

Referenced by begin(), and end().

◆ iterator

template<typename T>
friend class iterator
friend

Definition at line 258 of file borderiterator.h.

Referenced by begin(), and end().

Member Data Documentation

◆ _inside

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

Definition at line 253 of file borderiterator.h.

Referenced by BorderIterator(), BorderIterator(), BorderIterator(), and operator==().

◆ _sizeinf

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

Definition at line 254 of file borderiterator.h.

Referenced by BorderIterator(), BorderIterator(), BorderIterator(), and operator==().

◆ _sizesup

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

Definition at line 255 of file borderiterator.h.

Referenced by BorderIterator(), BorderIterator(), BorderIterator(), and operator==().

◆ _volume

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

Definition at line 252 of file borderiterator.h.

Referenced by BorderIterator(), BorderIterator(), BorderIterator(), and operator==().


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