Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::Offset< VOffsetDimension > Class Template Reference
[Image Access Objects]

#include <itkOffset.h>

Inheritance diagram for itk::Offset< VOffsetDimension >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<unsigned int VOffsetDimension = 2>
class itk::Offset< VOffsetDimension >

Represent the offset between two n-dimensional indexes in a n-dimensional image.

Offset is a templated class to represent a multi-dimensional offset, i.e. (i,j,k,...). Offset is templated over the dimension of the space.

For the sake of efficiency, Offset does not define a default constructor, a copy constructor, or an operator=. We rely on the compiler to provide efficient bitwise copies.

See also:
Index

Definition at line 48 of file itkOffset.h.

Public Types

typedef Offset< VOffsetDimension > OffsetType
typedef long OffsetValueType
typedef Offset Self

Public Member Functions

void Fill (OffsetValueType value)
const OffsetValueTypeGetOffset () const
Compare two offsets *bool operator!= (const Self &vec) const
Add a size to an offset *const
Self 
operator+ (const Size< VOffsetDimension > &size) const
Add an offset to an offset
*const Self 
operator+ (const Self &offset) const
Increment offset by an offset
*const Self
operator+= (const Self &vec)
Increment index by a size
*const Self
operator+= (const Size< VOffsetDimension > &size)
Subtract two offsets *const
Self 
operator- (const Self &vec)
Decrement offset by an offset
*const Self
operator-= (const Self &vec)
Decrement index by a size
*const Self
operator-= (const Size< VOffsetDimension > &size)
Compare two offsets *bool operator== (const Self &vec) const
OffsetValueType operator[] (unsigned int dim) const
OffsetValueTypeoperator[] (unsigned int dim)
void SetOffset (const OffsetValueType val[VOffsetDimension])

Static Public Member Functions

static Self GetBasisOffset (unsigned int dim)
static unsigned int GetOffsetDimension ()

Public Attributes

OffsetValueType m_Offset [VOffsetDimension]


Member Typedef Documentation

template<unsigned int VOffsetDimension = 2>
typedef Offset<VOffsetDimension> itk::Offset< VOffsetDimension >::OffsetType
 

Compatible offset typedefs.

Definition at line 57 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
typedef long itk::Offset< VOffsetDimension >::OffsetValueType
 

Definition at line 58 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
typedef Offset itk::Offset< VOffsetDimension >::Self
 

Standard class typedefs.

Definition at line 51 of file itkOffset.h.


Member Function Documentation

template<unsigned int VOffsetDimension = 2>
void itk::Offset< VOffsetDimension >::Fill OffsetValueType  value  )  [inline]
 

Set one value for the offset in all dimensions. Useful for initializing an offset to zero.

Definition at line 184 of file itkOffset.h.

template<unsigned int VOffsetDimension>
Offset< VOffsetDimension > itk::Offset< VOffsetDimension >::GetBasisOffset unsigned int  dim  )  [static]
 

Return a basis vector of the form [0, ..., 0, 1, 0, ... 0] where the "1" is positioned in the location specified by the parameter "dim". Valid values of "dim" are 0, ..., VOffsetDimension-1.

Definition at line 200 of file itkOffset.h.

References itk::Offset< VOffsetDimension >::m_Offset.

template<unsigned int VOffsetDimension = 2>
const OffsetValueType* itk::Offset< VOffsetDimension >::GetOffset void   )  const [inline]
 

Get the index. This provides a read only reference to the index.

See also:
SetOffset()

Definition at line 168 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
static unsigned int itk::Offset< VOffsetDimension >::GetOffsetDimension  )  [inline, static]
 

Get the dimension (size) of the index.

Definition at line 54 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Compare two offsets* bool itk::Offset< VOffsetDimension >::operator!= const Self vec  )  const [inline]
 

Definition at line 146 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Add a size to an offset* const Self itk::Offset< VOffsetDimension >::operator+ const Size< VOffsetDimension > &  size  )  const [inline]
 

Definition at line 73 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Add an offset to an offset* const Self itk::Offset< VOffsetDimension >::operator+ const Self offset  )  const [inline]
 

Definition at line 62 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Increment offset by an offset* const Self& itk::Offset< VOffsetDimension >::operator+= const Self vec  )  [inline]
 

Definition at line 115 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Increment index by a size* const Self& itk::Offset< VOffsetDimension >::operator+= const Size< VOffsetDimension > &  size  )  [inline]
 

Definition at line 84 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Subtract two offsets* const Self itk::Offset< VOffsetDimension >::operator- const Self vec  )  [inline]
 

Definition at line 104 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Decrement offset by an offset* const Self& itk::Offset< VOffsetDimension >::operator-= const Self vec  )  [inline]
 

Definition at line 125 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Decrement index by a size* const Self& itk::Offset< VOffsetDimension >::operator-= const Size< VOffsetDimension > &  size  )  [inline]
 

Definition at line 94 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
Compare two offsets* bool itk::Offset< VOffsetDimension >::operator== const Self vec  )  const [inline]
 

Definition at line 135 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
OffsetValueType itk::Offset< VOffsetDimension >::operator[] unsigned int  dim  )  const [inline]
 

Access an element of the index. Elements are numbered 0, ..., VOffsetDimension-1. This version can only be an rvalue. No bounds checking is performed.

Definition at line 163 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
OffsetValueType& itk::Offset< VOffsetDimension >::operator[] unsigned int  dim  )  [inline]
 

Access an element of the offset. Elements are numbered 0, ..., VOffsetDimension-1. No bounds checking is performed.

Definition at line 157 of file itkOffset.h.

template<unsigned int VOffsetDimension = 2>
void itk::Offset< VOffsetDimension >::SetOffset const OffsetValueType  val[VOffsetDimension]  )  [inline]
 

Set the index. Try to prototype this function so that val has to point to a block of memory that is the appropriate size.

See also:
GetOffset()

Definition at line 174 of file itkOffset.h.


Member Data Documentation

template<unsigned int VOffsetDimension = 2>
OffsetValueType itk::Offset< VOffsetDimension >::m_Offset[VOffsetDimension]
 

Offset is an "aggregate" class. Its data is public (m_Offset) allowing for fast and convienent instantiations/assignments.

The following syntax for assigning an index is allowed/suggested: Offset<3> index = {5, 2, 7};

Definition at line 192 of file itkOffset.h.

Referenced by itk::Offset< VDimension >::Fill(), itk::Offset< VOffsetDimension >::GetBasisOffset(), itk::Offset< VDimension >::GetOffset(), itk::Offset< VDimension >::operator!=(), itk::Offset< VDimension >::operator+(), itk::Offset< VDimension >::operator+=(), itk::Offset< VDimension >::operator-(), itk::Index::operator-(), itk::Offset< VDimension >::operator-=(), itk::Offset< VDimension >::operator==(), itk::Offset< VDimension >::operator[](), and itk::Offset< VDimension >::SetOffset().


The documentation for this class was generated from the following file:
Generated at Sun Jul 9 21:01:38 2006 for ITK by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2000