1 #ifndef AIMSDATA_BORDER_BORDERITERATOR_H 2 #define AIMSDATA_BORDER_BORDERITERATOR_H 58 std::vector<int> borders =
_volume.getBorders();
91 std::vector<int> borders =
_volume.getBorders();
262 template <
typename T>
268 template <
typename T>
282 template <
typename T>
289 template <
typename T>
296 template <
typename T>
303 template <
typename T>
312 template <
typename T>
321 template <
typename T>
327 template <
typename T>
333 template <
typename T>
339 template <
typename T>
345 template <
typename T>
348 return !(*
this == other);
351 template <
typename T>
354 return !(*
this == other);
357 template <
typename T>
366 template <
typename T>
372 return _border._volume.getSizeX();
375 template <
typename T>
381 if( ( p[0] < 0 ) || ( p[0] >=
_border._volume.getSizeX() ) ||
382 ( p[1] < 0 ) || ( p[1] >=
_border._volume.getSizeY() ) ||
383 ( p[2] < 0 ) || ( p[2] >=
_border._volume.getSizeZ() ) ||
384 ( p[3] < 0 ) || ( p[3] >=
_border._volume.getSizeT() ) )
387 else if( ( p[0] <
_border._sizeinf[0] ) ||
388 ( p[0] >=
_border._volume.getSizeX() -
_border._sizesup[0] + 1 ) ||
389 ( p[1] <
_border._sizeinf[1] ) ||
390 ( p[1] >=
_border._volume.getSizeY() -
_border._sizesup[1] + 1 ) ||
391 ( p[2] <
_border._sizeinf[2] ) ||
392 ( p[2] >=
_border._volume.getSizeZ() -
_border._sizesup[2] + 1 ) ||
393 ( p[3] <
_border._sizeinf[3] ) ||
394 ( p[3] >=
_border._volume.getSizeT() -
_border._sizesup[3] + 1 ) )
403 if( ( p[0] < -
_border._sizeinf[0] ) ||
405 ( p[1] < -
_border._sizeinf[1] ) ||
407 ( p[2] < -
_border._sizeinf[2] ) ||
409 ( p[3] < -
_border._sizeinf[3] ) ||
413 else if( ( p[0] < 0 ) || ( p[0] >=
_border._volume.getSizeX() ) ||
414 ( p[1] < 0 ) || ( p[1] >=
_border._volume.getSizeY() ) ||
415 ( p[2] < 0 ) || ( p[2] >=
_border._volume.getSizeZ() ) ||
416 ( p[3] < 0 ) || ( p[3] >=
_border._volume.getSizeT() ) )
424 template <
typename T>
436 return( 0 <= p[0] && p[0] <
_border._volume.getSizeX() &&
437 0 <= p[1] && p[1] <
_border._volume.getSizeY() &&
438 0 <= p[2] && p[2] <
_border._volume.getSizeZ() &&
439 0 <= p[3] && p[3] <
_border._volume.getSizeT() );
443 template <
typename T>
453 else if( move[1] > 0 )
455 else if( move[2] > 0 )
457 else if( move[3] > 0 )
463 newp[0] = -
_border._sizeinf[0];
464 else if( move[1] > 0 )
465 newp[1] = -
_border._sizeinf[1];
466 else if( move[2] > 0 )
467 newp[2] = -
_border._sizeinf[2];
468 else if( move[3] > 0 )
469 newp[3] = -
_border._sizeinf[3];
475 template <
typename T>
481 else if( move[1] > 0 )
483 else if( move[2] > 0 )
485 else if( move[3] > 0 )
492 template <
typename T>
508 next =
reset( next, move );
520 template <
typename T>
527 template <
typename T>
536 template <
typename T>
541 template <
typename T>
546 template <
typename T>
551 template <
typename T>
557 template <
typename T>
565 template <
typename T>
575 template <
typename T>
585 template <
typename T>
593 template <
typename T>
604 #endif // AIMSDATA_BORDER_BORDERITERATOR_H
const T & operator*() const
long jumpX() const
Gives the size of the non-border volume in the X dimension.
Point4dl nextMove(const Point4dl &move) const
Computes the next move.
iterator & operator++()
increment (prefix)
The class for EcatSino data write operation.
bool operator==(const BorderIterator< T > &other) const
BorderIterator(carto::VolumeRef< T > in, bool inside=false, const Point4dl &size=Point4dl(-1, -1, -1, -1))
Border constructor.
iterator & operator=(const iterator &other)
assignment from iterator
bool operator==(const const_iterator &other) const
carto::VolumeRef< T > volume()
Returns a reference to the linked volume.
const_iterator()
Default constructor Create a non initialized iterator than cannot be incremented or accessed...
iterator()
Default constructor Create a non initialized iterator than cannot be incremented or accessed...
const_iterator end() const
const_iterator & operator++()
increment (prefix)
carto::VolumeRef< T > _volume
Point4dl coordinate() const
Returns the coordinates of the current point in the linked volume.
bool isNonBorderImage(const Point4dl &p) const
returns true if p is in the image but not in the border.
const T * operator->() const
Represents the border of a volume.
BorderIterator< T > _border
const_iterator begin() const
const_iterator & operator=(const const_iterator &other)
assignment from const_iterator
Point4dl end() const
Point value for the "end" iterator (which points to no voxel).
Point4dl reset(const Point4dl &p, const Point4dl &move) const
Sets the coordinate (in the dimension described by move) at its most inferior (i.e.
BorderIterator(carto::VolumeRef< T > in, bool inside, const Point4dl &sizeinf, const Point4dl &sizesup)
Point4dl computeNext(const Point4dl &p) const
computeNext(p) returns the next point in the border.
bool operator!=(const const_iterator &other) const
bool isBorder(const Point4dl &p) const
returns true if the p is in the border described by _border