MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
mds::img::CRectBox< V > Class Template Reference

Class template representing a rectangular box within an existing volume. More...

#include <mdsVolumeView.h>

Inheritance diagram for mds::img::CRectBox< V >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_VOLUME_VIEW }
 Simple tag of "volume view" classes. More...
enum  { TEMPLATE_PARAMETER_IS_NOT_VOLUME = V::CLASS_VOLUME }
 Check that V is a volume. More...
typedef CVolumeBase< CRectBox
< V > > 
tBase
 Base class.
typedef V tVolume
 Volume type.
typedef V::tVoxel tVoxel
 Voxel type.

Public Member Functions

tVoxel & at (tSize x, tSize y, tSize z)
 Returns the voxel [x][y][z].
const tVoxel & at (tSize x, tSize y, tSize z) const
tVoxel & at (tSize i)
 Returns the subscripted voxel.
const tVoxel & at (tSize i) const
void copyFrom (const tVoxel *pSrc)
 Fills the box using a given input buffer.
void copyTo (tVoxel *pDst) const
 Copies the box data to the output buffer.
 CRectBox (const tVolume &Volume, tSize x, tSize y, tSize z, tSize XSize, tSize YSize, tSize ZSize)
 Constructor...
 CRectBox (const tVolume &Volume, const CPoint3i &Pos, const CSize3i &Size)
 Yet another constructor...
 CRectBox (const tVolume &Volume, const CRange &XRange, const CRange &YRange, const CRange &ZRange)
 Yet another constructor...
 CRectBox (const CRectBox &Box)
 Copy constructor.
tSize depth () const
CRectBox & fill (const tVoxel &c)
 Fills the box using a given voxel value.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every voxel.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every voxel in the box.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every voxel in the box.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every voxel.
tSize getIdx (tSize x, tSize y, tSize z) const
 Calculates index of the voxel [x][y][z].
tVolume & getImpl ()
 Returns reference to the volume data implementation.
const tVolume & getImpl () const
tSize getMargin () const
 Returns the volume Margin size in voxels.
CPoint3i & getPos ()
 Returns position of the left upper corner.
const CPoint3i & getPos () const
CSize3i & getSize ()
 Returns size of the rectangle.
const CSize3i & getSize () const
tVolume & getVolumeRef () const
 Returns reference to the original volume.
tSize getXOffset () const
 Returns offset between two neigbouring voxels in x-axis.
tSize getXSize () const
 Returns the volume size (dimensions).
tSize getYOffset () const
 Returns offset between two neigbouring voxels in y-axis.
tSize getYSize () const
tSize getZOffset () const
 Returns offset between two neigbouring voxels in z-axis.
tSize getZSize () const
tSize height () const
tVoxel & operator() (tSize x, tSize y, tSize z)
 Returns the subscripted voxel [x][y][z].
const tVoxel & operator() (tSize x, tSize y, tSize z) const
tVoxel & operator() (tSize i)
 Returns the subscripted voxel.
const tVoxel & operator() (tSize i) const
template<class Derived >
CRectBox< V > & operator*= (const CVolumeBase< Derived > &Volume)
template<class Derived >
CRectBox & operator*= (const CVolumeBase< Derived > &Volume)
 Voxel wise product.
template<typename U >
CRectBox< V > & operator*= (const U &c)
template<typename U >
CRectBox & operator*= (const U &c)
 Multiplies all voxels by scalar.
template<class Derived >
CRectBox< V > & operator+= (const CVolumeBase< Derived > &Volume)
template<typename U >
CRectBox< V > & operator+= (const U &c)
template<class Derived >
CRectBox & operator+= (const CVolumeBase< Derived > &Volume)
 Voxel wise addition.
template<typename U >
CRectBox & operator+= (const U &c)
 Adds scalar to all voxels.
template<class Derived >
CRectBox< V > & operator-= (const CVolumeBase< Derived > &Volume)
template<class Derived >
CRectBox & operator-= (const CVolumeBase< Derived > &Volume)
 Voxel wise subtraction.
template<typename U >
CRectBox< V > & operator-= (const U &c)
template<typename U >
CRectBox & operator-= (const U &c)
 Subtracts scalar from all voxels.
template<class Derived >
CRectBox< V > & operator/= (const CVolumeBase< Derived > &Volume)
template<class Derived >
CRectBox & operator/= (const CVolumeBase< Derived > &Volume)
 Voxel wise division.
template<typename U >
CRectBox< V > & operator/= (const U &c)
template<typename U >
CRectBox & operator/= (const U &c)
 Divides all voxels by scalar.
template<class Function >
Function pforEach (Function Func)
 Calls a function object for every voxel in the box.
template<class Function >
Function pforEach (Function Func) const
 Calls a function object for every voxel in the box.
template<class Function >
Function pforEach (Function Func)
 Calls a function object for every voxel.
template<class Function >
Function pforEach (Function Func) const
 Calls a function object for every voxel.
tVolume & set (tSize x, tSize y, tSize z, const tVoxel &Value)
 Sets the voxel at the position [x][y][z].
CRectBox & set (tSize x, tSize y, tSize z, const tVoxel &Value)
 Sets the voxel at the position [x][y][z].
tVolume & set (tSize i, const tVoxel &Value)
 Sets the subscripted voxel.
CRectBox & set (tSize i, const tVoxel &Value)
 Sets the subsripted voxel.
tSize width () const
 Returns the volume size (dimensions).

Protected Member Functions

CRectBox & operator= (const CRectBox &)
 Proctected assignment operator.

Protected Attributes

CPoint3i m_Pos
 Coordinates of the box origin.
CSize3i m_Size
 Size of the box.
tVolume & m_Volume
 Reference to the original volume.

Detailed Description

template<class V>
class mds::img::CRectBox< V >

Class template representing a rectangular box within an existing volume.


Member Typedef Documentation

template<class V >
typedef CVolumeBase<CRectBox<V> > mds::img::CRectBox< V >::tBase

Base class.

template<class V >
typedef V mds::img::CRectBox< V >::tVolume

Volume type.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
typedef V::tVoxel mds::img::CRectBox< V >::tVoxel

Voxel type.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.


Member Enumeration Documentation

anonymous enum [inherited]

Simple tag of "volume view" classes.

Enumerator:
CLASS_VOLUME_VIEW 
template<class V >
anonymous enum

Check that V is a volume.

You will see name of this enum somewhere in compiler error message if the type V is not volume.

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_VOLUME 

Constructor & Destructor Documentation

template<class V >
CRectBox::CRectBox ( const tVolume &  Volume,
tSize  x,
tSize  y,
tSize  z,
tSize  XSize,
tSize  YSize,
tSize  ZSize 
)

Constructor...

template<class V >
CRectBox::CRectBox ( const tVolume &  Volume,
const CPoint3i &  Pos,
const CSize3i &  Size 
)

Yet another constructor...

template<class V >
CRectBox::CRectBox ( const tVolume &  Volume,
const CRange &  XRange,
const CRange &  YRange,
const CRange &  ZRange 
)

Yet another constructor...

template<class V >
mds::img::CRectBox< V >::CRectBox ( const CRectBox< V > &  Box)

Copy constructor.


Member Function Documentation

template<class V >
tVoxel& mds::img::CRectBox< V >::at ( tSize  x,
tSize  y,
tSize  z 
)

Returns the voxel [x][y][z].

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
const tVoxel& mds::img::CRectBox< V >::at ( tSize  x,
tSize  y,
tSize  z 
) const
template<class V >
tVoxel& mds::img::CRectBox< V >::at ( tSize  i)

Returns the subscripted voxel.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
const tVoxel& mds::img::CRectBox< V >::at ( tSize  i) const
template<class V >
void CRectBox::copyFrom ( const tVoxel *  pSrc)

Fills the box using a given input buffer.

template<class V >
void CRectBox::copyTo ( tVoxel *  pDst) const

Copies the box data to the output buffer.

template<class V >
tSize mds::img::CRectBox< V >::depth ( ) const
template<class V >
CRectBox< V > & CRectBox::fill ( const tVoxel &  c)

Fills the box using a given voxel value.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::forEach ( Function  Func)

Calls a function object for every voxel.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::forEach ( Function  Func)

Calls a function object for every voxel in the box.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::forEach ( Function  Func) const

Calls a function object for every voxel in the box.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::forEach ( Function  Func) const

Calls a function object for every voxel.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
tSize mds::img::CRectBox< V >::getIdx ( tSize  x,
tSize  y,
tSize  z 
) const

Calculates index of the voxel [x][y][z].

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

tVolume& mds::img::CVolumeBase< CRectBox< V > >::getImpl ( ) [inherited]

Returns reference to the volume data implementation.

const tVolume& mds::img::CVolumeBase< CRectBox< V > >::getImpl ( ) const [inherited]
template<class V >
tSize mds::img::CRectBox< V >::getMargin ( ) const

Returns the volume Margin size in voxels.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
CPoint3i& mds::img::CRectBox< V >::getPos ( )

Returns position of the left upper corner.

template<class V >
const CPoint3i& mds::img::CRectBox< V >::getPos ( ) const
template<class V >
CSize3i& mds::img::CRectBox< V >::getSize ( )

Returns size of the rectangle.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
const CSize3i& mds::img::CRectBox< V >::getSize ( ) const
template<class V >
tVolume& mds::img::CRectBox< V >::getVolumeRef ( ) const

Returns reference to the original volume.

template<class V >
tSize mds::img::CRectBox< V >::getXOffset ( ) const

Returns offset between two neigbouring voxels in x-axis.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
tSize mds::img::CRectBox< V >::getXSize ( ) const

Returns the volume size (dimensions).

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
tSize mds::img::CRectBox< V >::getYOffset ( ) const

Returns offset between two neigbouring voxels in y-axis.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
tSize mds::img::CRectBox< V >::getYSize ( ) const
template<class V >
tSize mds::img::CRectBox< V >::getZOffset ( ) const

Returns offset between two neigbouring voxels in z-axis.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
tSize mds::img::CRectBox< V >::getZSize ( ) const
template<class V >
tSize mds::img::CRectBox< V >::height ( ) const
template<class V >
tVoxel& mds::img::CRectBox< V >::operator() ( tSize  x,
tSize  y,
tSize  z 
)

Returns the subscripted voxel [x][y][z].

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
const tVoxel& mds::img::CRectBox< V >::operator() ( tSize  x,
tSize  y,
tSize  z 
) const
template<class V >
tVoxel& mds::img::CRectBox< V >::operator() ( tSize  i)

Returns the subscripted voxel.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
const tVoxel& mds::img::CRectBox< V >::operator() ( tSize  i) const
template<class V >
template<class Derived >
CRectBox<V>& mds::img::CRectBox< V >::operator*= ( const CVolumeBase< Derived > &  Volume)
template<class V >
template<class Derived >
CRectBox< V > & mds::img::CRectBox< V >::operator*= ( const CVolumeBase< Derived > &  Volume)

Voxel wise product.

template<class V >
template<typename U >
CRectBox<V>& mds::img::CRectBox< V >::operator*= ( const U &  c)
template<class V >
template<typename U >
CRectBox< V > & mds::img::CRectBox< V >::operator*= ( const U &  c)

Multiplies all voxels by scalar.

  • An operator that allows conversion U -> T must be defined!
template<class V >
template<class Derived >
CRectBox<V>& mds::img::CRectBox< V >::operator+= ( const CVolumeBase< Derived > &  Volume)
template<class V >
template<typename U >
CRectBox<V>& mds::img::CRectBox< V >::operator+= ( const U &  c)
template<class V >
template<class Derived >
CRectBox< V > & mds::img::CRectBox< V >::operator+= ( const CVolumeBase< Derived > &  Volume)

Voxel wise addition.

template<class V >
template<typename U >
CRectBox< V > & mds::img::CRectBox< V >::operator+= ( const U &  c)

Adds scalar to all voxels.

  • An operator that allows conversion from U to T must be defined!
template<class V >
template<class Derived >
CRectBox<V>& mds::img::CRectBox< V >::operator-= ( const CVolumeBase< Derived > &  Volume)
template<class V >
template<class Derived >
CRectBox< V > & mds::img::CRectBox< V >::operator-= ( const CVolumeBase< Derived > &  Volume)

Voxel wise subtraction.

template<class V >
template<typename U >
CRectBox<V>& mds::img::CRectBox< V >::operator-= ( const U &  c)
template<class V >
template<typename U >
CRectBox< V > & mds::img::CRectBox< V >::operator-= ( const U &  c)

Subtracts scalar from all voxels.

  • An operator that allows conversion U -> T must be defined!
template<class V >
template<class Derived >
CRectBox<V>& mds::img::CRectBox< V >::operator/= ( const CVolumeBase< Derived > &  Volume)
template<class V >
template<class Derived >
CRectBox< V > & mds::img::CRectBox< V >::operator/= ( const CVolumeBase< Derived > &  Volume)

Voxel wise division.

template<class V >
template<typename U >
CRectBox<V>& mds::img::CRectBox< V >::operator/= ( const U &  c)
template<class V >
template<typename U >
CRectBox< V > & mds::img::CRectBox< V >::operator/= ( const U &  c)

Divides all voxels by scalar.

  • An operator that allows conversion U -> T must be defined!
template<class V >
CRectBox& mds::img::CRectBox< V >::operator= ( const CRectBox< V > &  ) [protected]

Proctected assignment operator.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::pforEach ( Function  Func)

Calls a function object for every voxel in the box.

  • Parallel version.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::pforEach ( Function  Func) const

Calls a function object for every voxel in the box.

  • Parallel version.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::pforEach ( Function  Func)

Calls a function object for every voxel.

  • Parallel version.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

template<class V >
template<class Function >
Function mds::img::CRectBox< V >::pforEach ( Function  Func) const

Calls a function object for every voxel.

  • Parallel version.

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.

tVolume& mds::img::CVolumeBase< CRectBox< V > >::set ( tSize  x,
tSize  y,
tSize  z,
const tVoxel &  Value 
) [inherited]

Sets the voxel at the position [x][y][z].

template<class V >
CRectBox& mds::img::CRectBox< V >::set ( tSize  x,
tSize  y,
tSize  z,
const tVoxel &  Value 
)

Sets the voxel at the position [x][y][z].

tVolume& mds::img::CVolumeBase< CRectBox< V > >::set ( tSize  i,
const tVoxel &  Value 
) [inherited]

Sets the subscripted voxel.

template<class V >
CRectBox& mds::img::CRectBox< V >::set ( tSize  i,
const tVoxel &  Value 
)

Sets the subsripted voxel.

template<class V >
tSize mds::img::CRectBox< V >::width ( ) const

Returns the volume size (dimensions).

Reimplemented from mds::img::CVolumeBase< CRectBox< V > >.


Member Data Documentation

template<class V >
CPoint3i mds::img::CRectBox< V >::m_Pos [protected]

Coordinates of the box origin.

template<class V >
CSize3i mds::img::CRectBox< V >::m_Size [protected]

Size of the box.

template<class V >
tVolume& mds::img::CRectBox< V >::m_Volume [protected]

Reference to the original volume.


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